autodoc.git/
traditional_manual/
chapter_21.html
Branch:
Tag:
Non-build tags
All tags
No tags
2021-07-20
2021-07-20 11:11:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>
99eac2dc1f4152a2377ccb7295348cec32ea8525 (
2526
lines) (+
2386
/-
140
)
[
Show
|
Annotate
]
Branch:
master
Doc: Fixed AutoDoc markup typo.
484:
<hr /> <dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>__parse_pike_type</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string(8bit)</code> <b><span class='method'>__parse_pike_type</span>(</b><code class='datatype'>string(8bit)</code> <code class='argument'>t</code><b>)</b></code></p></dd>
+
</dl>
+
+
+
<hr />
+
<dl class='group--doc'>
<dt class='head--type'><span class='homogen--type'>Constant</span> <span class='homogen--name'><b>__placeholder_object</b></span> </dt>
541:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>_exit</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>_exit</span>(</b><code class='datatype'>int</code> <code class='argument'>returncode</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>This function does the same as <code>exit</code>, but doesn't bother to clean
+
up the Pike interpreter before exiting. This means that no destructors
+
will be called, caches will not be flushed, file locks might not be
+
released, and databases might not be closed properly.</p>
+
<p> Use with extreme caution.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>exit()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>_gdb_breakpoint</b></span> </dt> <dd><p><code><code class='datatype'>void</code> <b><span class='method'>_gdb_breakpoint</span>(</b><b>)</b></code></p></dd>
650:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>add_constant</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_constant</span>(</b><code class='datatype'>string</code> <code class='argument'>name</code>, <code class='datatype'>mixed</code> <code class='argument'>value</code><b>)</b></code><br>
+
<code><code class='datatype'>void</code> <b><span class='method'>add_constant</span>(</b><code class='datatype'>string</code> <code class='argument'>name</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Add a new predefined constant.</p>
+
<p> This function is often used to add builtin functions.
+
All programs compiled after the <code>add_constant()</code> function has been
+
called can access <code>value</code> by the name <code>name</code>.</p>
+
<p> If there is a constant called <code>name</code> already, it will be replaced by
+
by the new definition. This will not affect already compiled programs.</p>
+
<p> Calling <code>add_constant()</code> without a value will remove that name from
+
the list of constants. As with replacing, this will not affect already
+
compiled programs.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>all_constants()</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_include_path</b></span> </dt> <dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_include_path</span>(</b><code class='datatype'>string</code> <code class='argument'>tmp</code><b>)</b></code></p></dd>
712:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>aggregate</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>array</code> <b><span class='method'>aggregate</span>(</b><code class='datatype'>mixed</code> ... <code class='argument'>elements</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Construct an array with the arguments as indices.</p>
+
<p> This function could be written in Pike as:</p>
+
<pre><code><span class='type'>array</span> aggregate<span class='delim'>(</span><span class='type'>mixed</span> ... elems<span class='delim'>)</span> <span class='delim'>{</span> <span class='lang'>return</span> elems<span class='delim'>;</span> <span class='delim'>}</span>
+
</code></pre>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Arrays are dynamically allocated there is no need to declare them
+
like <code class='expr'>int a[10]=allocate(10);</code> (and it isn't possible either) like
+
in C, just <code class='expr'>array(int) a=allocate(10);</code> will do.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>sizeof()</code>, <code>arrayp()</code>, <code>allocate()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>aggregate_mapping</b></span> </dt> <dd><p><code><code class='datatype'>mapping</code> <b><span class='method'>aggregate_mapping</span>(</b><code class='datatype'>mixed</code> ... <code class='argument'>elems</code><b>)</b></code></p></dd>
778:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>all_constants</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>mixed</code>) <b><span class='method'>all_constants</span>(</b><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns a mapping containing all global constants, indexed on the name
+
of the constant, and with the value of the constant as value.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>add_constant()</code></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>
+
</dt>
+
<dd><p><code><code class='datatype'>array</code> <b><span class='method'>allocate</span>(</b><code class='datatype'>int</code> <code class='argument'>size</code><b>)</b></code><br>
+
<code><code class='datatype'>array</code> <b><span class='method'>allocate</span>(</b><code class='datatype'>int</code> <code class='argument'>size</code>, <code class='datatype'>mixed</code> <code class='argument'>init</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Allocate an array of <code>size</code> elements. If <code>init</code> is specified
+
then each element is initialized by copying that value
+
recursively.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>sizeof()</code>, <code>aggregate()</code>, <code>arrayp()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>array_sscanf</b></span> </dt> <dd><p><code><code class='datatype'>array</code> <b><span class='method'>array_sscanf</span>(</b><code class='datatype'>string</code> <code class='argument'>data</code>, <code class='datatype'>string</code> <code class='argument'>format</code><b>)</b></code></p></dd>
1071:
<dt class='head--type'><span class='homogen--type'>Method</span> <span class='homogen--name'><b>compile</b></span> </dt>
+
<dd><p><code><code class='datatype'>program</code> <b><span class='method'>compile</span>(</b><code class='datatype'>string</code> <code class='argument'>source</code>, <code class='object unresolved'>CompilationHandler</code>|<code class='datatype'>void</code> <code class='argument'>handler</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>major</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>minor</code>, <code class='datatype'>program</code>|<code class='datatype'>void</code> <code class='argument'>target</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>placeholder</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Compile a string to a program.</p>
+
<p> This function takes a piece of Pike code as a string and
+
compiles it into a clonable program.</p>
+
<p> The optional argument <code>handler</code> is used to specify an alternative
+
error handler. If it is not specified the current master object will
+
be used.</p>
+
<p> The optional arguments <code>major</code> and <code>minor</code> are used to tell the
+
compiler to attempt to be compatible with Pike <code>major</code>.<code>minor</code>.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Note that <code>source</code> must contain the complete source for a program.
+
It is not possible to compile a single expression or statement.</p>
+
<p> Also note that <code>compile()</code> does not preprocess the program.
+
To preprocess the program you can use <code>compile_string()</code> or
+
call the preprocessor manually by calling <code>cpp()</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>compile_string()</code>, <code>compile_file()</code>, <code>cpp()</code>, <code>master()</code>,
+
<code>CompilationHandler</code>, <code>DefaultCompilerEnvironment</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>compile</b></span>
+
</dt>
<dd><p><code><code class='modifier'>protected</code> <code class='datatype'>program</code> <b><span class='method'>compile</span>(</b><code class='datatype'>string</code> <code class='argument'>source</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>handler</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>major</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>minor</code>, <code class='datatype'>program</code>|<code class='datatype'>void</code> <code class='argument'>target</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>placeholder</code><b>)</b></code></p></dd> </dl>
1113:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>copy_value</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>copy_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>Copy a value recursively.</p>
+
<p> If the result value is changed destructively (only possible for
+
multisets, arrays and mappings) the copied value will not be changed.</p>
+
<p> The resulting value will always be equal to the copied (as tested with
+
the function <code>equal()</code>), but they may not the the same value (as tested
+
with <code>`==()</code>).</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>equal()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>cos</b></span> </dt> <dd><p><code><code class='datatype'>float</code> <b><span class='method'>cos</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>f</code><b>)</b></code></p></dd>
1248:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>delay</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>delay</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>s</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>This function makes the thread stop for <code>s</code> seconds.</p>
+
<p> Only signal handlers can interrupt the sleep. Other callbacks are
+
not called during delay. Beware that this function uses busy-waiting
+
to achieve the highest possible accuracy.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>signal()</code>, <code>sleep()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>depth</b></span> </dt> <dd><p><code><code class='datatype'>int(0..)</code> <b><span class='method'>depth</span>(</b><b>)</b></code></p></dd>
1300:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>destruct</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>bool</code> <b><span class='method'>destruct</span>(</b><code class='datatype'>void</code>|<code class='datatype'>object</code> <code class='argument'>o</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Mark an object as destructed.</p>
+
<p> Calls <code class='expr'>o->_destruct()</code>, and then clears all variables in the
+
object. If no argument is given, the current object is destructed.</p>
+
<p> All pointers and function pointers to this object will become zero.
+
The destructed object will be freed from memory as soon as possible.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if <code>o</code> has an <code>lfun::_destruct()</code> that
+
returned <code class='expr'>1</code> and inhibited destruction.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>encode_value</b></span> </dt> <dd><p><code><code class='datatype'>string</code> <b><span class='method'>encode_value</span>(</b><code class='datatype'>mixed</code> <code class='argument'>value</code>, <code class='object unresolved'>Codec</code>|<code class='datatype'>void</code> <code class='argument'>codec</code><b>)</b></code></p></dd>
1364:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>enumerate</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>enumerate</span>(</b><code class='datatype'>int</code> <code class='argument'>n</code><b>)</b></code><br>
+
<code><code class='datatype'>array</code> <b><span class='method'>enumerate</span>(</b><code class='datatype'>int</code> <code class='argument'>n</code>, <code class='datatype'>void</code>|<code class='datatype'>mixed</code> <code class='argument'>step</code>, <code class='datatype'>void</code>|<code class='datatype'>mixed</code> <code class='argument'>start</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>operator</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Create an array with an enumeration, useful for initializing arrays
+
or as first argument to <code>map()</code> or <code>foreach()</code>.</p>
+
<p> The defaults are: <code>step</code> = 1, <code>start</code> = 0, <code>operator</code> = <code>`+</code></p>
+
<h1>Advanced use</h1>
+
<p>The resulting array is calculated like this:</p>
+
<pre><code><span class='type'>array</span> enumerate<span class='delim'>(</span><span class='type'>int</span> n<span class='delim'>,</span> <span class='type'>mixed</span> step<span class='delim'>,</span> <span class='type'>mixed</span> start<span class='delim'>,</span> <span class='type'>function</span> operator<span class='delim'>)</span>
+
<span class='delim'>{</span>
+
<span class='type'>array</span> res <span class='delim'>=</span> allocate<span class='delim'>(</span>n<span class='delim'>)</span><span class='delim'>;</span>
+
<span class='lang'>for</span> <span class='delim'>(</span><span class='type'>int</span> i<span class='delim'>=</span>0<span class='delim'>;</span> i <span class='delim'><</span> n<span class='delim'>;</span> i++<span class='delim'>)</span>
+
<span class='delim'>{</span>
+
res<span class='delim'>[</span>i<span class='delim'>]</span> <span class='delim'>=</span> start<span class='delim'>;</span>
+
start <span class='delim'>=</span> operator<span class='delim'>(</span>start<span class='delim'>,</span> step<span class='delim'>)</span><span class='delim'>;</span>
+
<span class='delim'>}</span>
+
<span class='lang'>return</span> res<span class='delim'>;</span>
+
<span class='delim'>}</span>
+
</code></pre>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>map()</code>, <code>foreach()</code></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>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>equal</span>(</b><code class='datatype'>mixed</code> <code class='argument'>a</code>, <code class='datatype'>mixed</code> <code class='argument'>b</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>This function checks if the values <code>a</code> and <code>b</code> are equivalent.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>If either of the values is an object the (normalized) result
+
of calling <code>lfun::_equal()</code> will be returned.</p>
+
<p> Returns <code class='expr'>1</code> if both values are false (zero, destructed objects,
+
prototype functions, etc).</p>
+
<p> Returns <code class='expr'>0</code> (zero) if the values have different types.</p>
+
<p> Otherwise depending on the type of the values:</p>
+
<table class='box'><tr><td><code><code class='datatype'>int</code></code></td><td><p>Returns the same as <code class='expr'>a == b</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>array</code></code></td><td><p>The contents of <code>a</code> and <code>b</code> are checked recursively, and
+
if all their contents are <code>equal</code> and in the same place,
+
they are considered equal.</p>
+
<p> Note that for objects this case is only reached if neither
+
<code>a</code> nor <code>b</code> implements <code>lfun::_equal()</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='type'>type</code></code></td><td><p>Returns <code class='expr'>(a <= b) && (b <= a)</code>.</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>copy_value()</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>error</b></span> </dt> <dd><p><code><code class='datatype'>void</code> <b><span class='method'>error</span>(</b><code class='object unresolved'>sprintf_format</code> <code class='argument'>f</code>, <code class='object unresolved'>sprintf_args</code> ... <code class='argument'>args</code><b>)</b></code></p></dd>
1436:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>exit</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>exit</span>(</b><code class='datatype'>int</code> <code class='argument'>returncode</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>fmt</code>, <code class='datatype'>mixed</code> ... <code class='argument'>extra</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Exit the whole Pike program with the given <code>returncode</code>.</p>
+
<p> Using <code>exit()</code> with any other value than <code class='expr'>0</code> (zero) indicates
+
that something went wrong during execution. See your system manuals
+
for more information about return codes.</p>
+
<p> The arguments after the <code>returncode</code> will be used for a call to
+
<code>werror</code> to output a message on stderr.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>_exit()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>exp</b></span> </dt> <dd><p><code><code class='datatype'>float</code> <b><span class='method'>exp</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code> <code class='argument'>f</code><b>)</b></code></p></dd>
1452:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>filter</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>filter</span>(</b><code class='datatype'>mixed</code> <code class='argument'>arr</code>, <code class='datatype'>void</code>|<code class='datatype'>mixed</code> <code class='argument'>fun</code>, <code class='datatype'>mixed</code> ... <code class='argument'>extra</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Filters the elements in <code>arr</code> through <code>fun</code>.</p>
+
<p> <code>arr</code> is treated as a set of elements to be filtered, as
+
follows:</p>
+
<dl class='group--doc'><dt>array</dt>
+
<dt>multiset</dt>
+
<dt>string</dt>
+
<dd><p>Each element is filtered with <code>fun</code>. The return value is of
+
the same type as <code>arr</code> and it contains the elements that
+
<code>fun</code> accepted. <code>fun</code> is applied in order to each element,
+
and that order is retained between the kept elements.</p>
+
<p> If <code>fun</code> is an array, it should have the same length as
+
<code>arr</code>. In this case, the elements in <code>arr</code> are kept where
+
the corresponding positions in <code>fun</code> are nonzero. Otherwise
+
<code>fun</code> is used as described below.</p>
+
</dd>
+
<dt>mapping</dt>
+
<dd><p>The values are filtered with <code>fun</code>, and the index/value
+
pairs it accepts are kept in the returned mapping.</p>
+
</dd>
+
<dt>program</dt>
+
<dd><p>The program is treated as a mapping containing the
+
identifiers that are indexable from it and their values.</p>
+
</dd>
+
<dt>object</dt>
+
<dd><p>If there is a <code>lfun::cast</code> method in the object, it's called
+
to try to cast the object to an array, a mapping, or a
+
multiset, in that order, which is then filtered as described
+
above.</p>
+
</dd>
+
</dl><p>Unless something else is mentioned above, <code>fun</code> is used as
+
filter like this:</p>
+
<dl class='group--doc'><dt>function</dt>
+
<dd><p><code>fun</code> is called for each element. It gets the current
+
element as the first argument and <code>extra</code> as the rest. The
+
element is kept if it returns true, otherwise it's filtered
+
out.</p>
+
</dd>
+
<dt>object</dt>
+
<dd><p>The object is used as a function like above, i.e. the
+
<code>lfun::`()</code> method in it is called.</p>
+
</dd>
+
<dt>multiset</dt>
+
<dt>mapping</dt>
+
<dd><p><code>fun</code> is indexed with each element. The element is kept if
+
the result is nonzero, otherwise it's filtered out.</p>
+
</dd>
+
<dt>"zero or left out"</dt>
+
<dd><p>Each element that is callable is called with <code>extra</code> as
+
arguments. The element is kept if the result of the call is
+
nonzero, otherwise it's filtered out. Elements that aren't
+
callable are also filtered out.</p>
+
</dd>
+
<dt>string</dt>
+
<dd><p>Each element is indexed with the given string. If the result
+
of that is zero then the element is filtered out, otherwise
+
the result is called with <code>extra</code> as arguments. The element
+
is kept if the return value is nonzero, otherwise it's
+
filtered out.</p>
+
<p> This is typically used when <code>arr</code> is a collection of
+
objects, and <code>fun</code> is the name of some predicate function
+
in them.</p>
+
</dd>
+
</dl>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The function is never destructive on <code>arr</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>map()</code>, <code>foreach()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>floor</b></span> </dt> <dd><p><code><code class='datatype'>float</code> <b><span class='method'>floor</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>f</code><b>)</b></code></p></dd>
1496:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>gc</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>gc</span>(</b><code class='datatype'>mapping</code>|<code class='datatype'>array</code>|<code class='datatype'>void</code> <code class='argument'>quick</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Force garbage collection.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-quick'></span>Parameter <code class='parameter'>quick</code></dt>
+
<dd></dd><dd class='body--doc'><p>Perform a quick garbage collection on just this value,
+
which must have been made weak by <code>set_weak_flag()</code>.
+
All values that only have a single reference from
+
<code>quick</code> will then be freed.</p>
+
<p> When <code>quick</code> hasn't been specified or is <code>UNDEFINED</code>,
+
this function checks all the memory for cyclic structures such
+
as arrays containing themselves and frees them if appropriate.
+
It also frees up destructed objects and things with only weak
+
references.</p>
+
<p> Normally there is no need to call this function since Pike will
+
call it by itself every now and then. (Pike will try to predict
+
when 20% of all arrays/object/programs in memory is 'garbage'
+
and call this routine then.)</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>The amount of garbage is returned. This is the number of arrays,
+
mappings, multisets, objects and programs that had no nonweak
+
external references during the garbage collection. It's normally
+
the same as the number of freed things, but there might be some
+
difference since _destruct() functions are called during freeing,
+
which can cause more things to be freed or allocated.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Pike.gc_parameters</code>, <code>Debug.gc_status</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_active_compilation_handler</b></span> </dt> <dd><p><code><code class='object unresolved'>CompilationHandler</code> <b><span class='method'>get_active_compilation_handler</span>(</b><b>)</b></code></p></dd>
1516:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>get_active_compiler</b></span>
+
</dt>
+
<dd><p><code><code class='object unresolved'>CompilerEnvironment.PikeCompiler</code>|<code class='datatype'>zero</code> <b><span class='method'>get_active_compiler</span>(</b><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns the most recent of the currently active pike compilers,
+
or <code>UNDEFINED</code> if none is active.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function should only be used during a call of <code>compile()</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>get_active_error_handler()</code>, <code>compile()</code>,
+
<code>master()->get_compilation_handler()</code>, <code>CompilationHandler</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_active_error_handler</b></span> </dt> <dd><p><code><code class='object unresolved'>CompilationHandler</code> <b><span class='method'>get_active_error_handler</span>(</b><b>)</b></code></p></dd>
1802:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>gethrdtime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>gethrdtime</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>nsec</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return the high resolution real time spent with threads disabled
+
since the Pike interpreter was started. The time is normally
+
returned in microseconds, but if the optional argument <code>nsec</code>
+
is nonzero it's returned in nanoseconds.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The actual accuracy on many systems is significantly less than
+
microseconds or nanoseconds. See <code>System.REAL_TIME_RESOLUTION</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>_disable_threads()</code>, <code>gethrtime()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>gethrtime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>gethrtime</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>nsec</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return the high resolution real time since some arbitrary event in
+
the past. The time is normally returned in microseconds, but if
+
the optional argument <code>nsec</code> is nonzero it's returned in
+
nanoseconds.</p>
+
<p> It's system dependent whether or not this time is monotonic, i.e.
+
if it's unaffected by adjustments of the calendaric clock in the
+
system. <code>System.REAL_TIME_IS_MONOTONIC</code> tells what it is. Pike
+
tries to use monotonic time for this function if it's available.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The actual accuracy on many systems is significantly less than
+
microseconds or nanoseconds. See <code>System.REAL_TIME_RESOLUTION</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>System.REAL_TIME_IS_MONOTONIC</code>, <code>System.REAL_TIME_RESOLUTION</code>,
+
<code>time()</code>, <code>System.gettimeofday()</code>, <code>gethrvtime()</code>,
+
<code>Pike.implicit_gc_real_time</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>gethrvtime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>gethrvtime</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>nsec</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return the CPU time that has been consumed by this process or
+
thread. -1 is returned if the system couldn't determine it. The
+
time is normally returned in microseconds, but if the optional
+
argument <code>nsec</code> is nonzero it's returned in nanoseconds.</p>
+
<p> The CPU time includes both user and system time, i.e. it's
+
approximately the same thing you would get by adding together the
+
"utime" and "stime" fields returned by <code>System.getrusage</code> (but
+
perhaps with better accuracy).</p>
+
<p> It's however system dependent whether or not it's the time
+
consumed in all threads or in the current one only;
+
<code>System.CPU_TIME_IS_THREAD_LOCAL</code> tells which. If both types are
+
available then thread local time is preferred.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The actual accuracy on many systems is significantly less than
+
microseconds or nanoseconds. See <code>System.CPU_TIME_RESOLUTION</code>.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The garbage collector might run automatically at any time. The
+
time it takes is not included in the figure returned by this
+
function, so that normal measurements aren't randomly clobbered
+
by it. Explicit calls to <code>gc</code> are still included, though.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The special function <code>gauge</code> is implemented with this function.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>System.CPU_TIME_IS_THREAD_LOCAL</code>, <code>System.CPU_TIME_RESOLUTION</code>,
+
<code>gauge()</code>, <code>System.getrusage()</code>, <code>gethrtime()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>getpid</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>getpid</span>(</b><b>)</b></code></p></dd>
1905:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>glob</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>bool</code> <b><span class='method'>glob</span>(</b><code class='datatype'>string</code> <code class='argument'>glob</code>, <code class='datatype'>string</code> <code class='argument'>str</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>glob</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>glob</code>, <code class='datatype'>string</code> <code class='argument'>str</code><b>)</b></code><br>
+
<code><code class='datatype'>array</code>(<code class='datatype'>string</code>) <b><span class='method'>glob</span>(</b><code class='datatype'>string</code> <code class='argument'>glob</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>str</code><b>)</b></code><br>
+
<code><code class='datatype'>array</code>(<code class='datatype'>string</code>) <b><span class='method'>glob</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>glob</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>str</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Match strings against a glob pattern.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-glob'></span>Parameter <code class='parameter'>glob</code></dt>
+
<dd></dd><dd class='body--doc'><table class='box'><tr><td><code><code class='datatype'>string</code></code></td><td><p>The glob pattern. A question sign ('?') matches any character
+
and an asterisk ('*') matches a string of arbitrary length. All
+
other characters only match themselves.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>array</code>(<code class='datatype'>string</code>)</code></td><td><p>the function returns the matching glob if any of the given
+
patterns match. Otherwise 0. If the second argument is an array
+
it will behave as if the first argument is a string (see
+
below)</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'><span id='p-str'></span>Parameter <code class='parameter'>str</code></dt>
+
<dd></dd><dd class='body--doc'><table class='box'><tr><td><code><code class='datatype'>string</code></code></td><td><p><code class='expr'>1</code> is returned if the string <code>str</code> matches <code>glob</code>,
+
<code class='expr'>0</code> (zero) otherwise.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>array</code>(<code class='datatype'>string</code>)</code></td><td><p>All strings in the array <code>str</code> are matched against <code>glob</code>,
+
and those that match are returned in an array (in the same
+
order).</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>sscanf()</code>, <code>Regexp</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>gmtime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>) <b><span class='method'>gmtime</span>(</b><code class='datatype'>int</code> <code class='argument'>timestamp</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Convert seconds since 00:00:00 UTC, Jan 1, 1970 into components.</p>
+
<p> This function works like <code>localtime()</code> but the result is
+
not adjusted for the local time zone.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>localtime()</code>, <code>time()</code>, <code>ctime()</code>, <code>mktime()</code>,
+
<code>strptime()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>has_index</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>has_index</span>(</b><code class='datatype'>string</code> <code class='argument'>haystack</code>, <code class='datatype'>int</code> <code class='argument'>index</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>has_index</span>(</b><code class='datatype'>array</code> <code class='argument'>haystack</code>, <code class='datatype'>int</code> <code class='argument'>index</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>has_index</span>(</b><code class='datatype'>mapping</code>|<code class='datatype'>multiset</code>|<code class='datatype'>object</code>|<code class='datatype'>program</code> <code class='argument'>haystack</code>, <code class='datatype'>mixed</code> <code class='argument'>index</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Search for <code>index</code> in <code>haystack</code>.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if <code>index</code> is in the index domain of <code>haystack</code>,
+
or <code class='expr'>0</code> (zero) if not found.</p>
+
<p> This function is equivalent to (but sometimes faster than):</p>
+
<pre><code>search(indices(haystack), index) != -1</code></pre>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>A negative index in strings and arrays as recognized by the
+
index operators <code class='expr'>`[]()</code> and <code class='expr'>`[]=()</code> is not considered
+
a proper index by <code>has_index()</code></p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>has_value()</code>, <code>has_prefix()</code>, <code>has_suffix()</code>, <code>indices()</code>,
+
<code>search()</code>, <code>values()</code>, <code>zero_type()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>has_prefix</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>has_prefix</span>(</b><code class='datatype'>string</code>|<code class='datatype'>object</code> <code class='argument'>s</code>, <code class='datatype'>string</code> <code class='argument'>prefix</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if the string <code>s</code> starts with <code>prefix</code>,
+
returns <code class='expr'>0</code> (zero) otherwise.</p>
+
<p> When <code>s</code> is an object, it needs to implement
+
<code>lfun::_sizeof()</code> and <code>lfun::`[]</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>has_suffix()</code>, <code>has_value()</code>, <code>search()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>has_suffix</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>has_suffix</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>string</code> <code class='argument'>suffix</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if the string <code>s</code> ends with <code>suffix</code>,
+
returns <code class='expr'>0</code> (zero) otherwise.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>has_prefix()</code>, <code>has_value()</code>, <code>search()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>has_value</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>has_value</span>(</b><code class='datatype'>string</code> <code class='argument'>haystack</code>, <code class='datatype'>string</code> <code class='argument'>value</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>has_value</span>(</b><code class='datatype'>string</code> <code class='argument'>haystack</code>, <code class='datatype'>int</code> <code class='argument'>value</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>has_value</span>(</b><code class='datatype'>array</code>|<code class='datatype'>mapping</code>|<code class='datatype'>object</code>|<code class='datatype'>program</code> <code class='argument'>haystack</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>Search for <code>value</code> in <code>haystack</code>.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if <code>value</code> is in the value domain of <code>haystack</code>,
+
or <code class='expr'>0</code> (zero) if not found.</p>
+
<p> This function is in all cases except when both arguments are strings
+
equivalent to (but sometimes faster than):</p>
+
<pre><code>search(values(haystack), value) != -1</code></pre><p>If both arguments are strings, <code>has_value()</code> is equivalent to:</p>
+
<pre><code>search(haystack, value) != -1</code></pre>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>has_index()</code>, <code>indices()</code>, <code>search()</code>, <code>has_prefix()</code>,
+
<code>has_suffix()</code>, <code>values()</code>, <code>zero_type()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>hash</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>hash</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>hash</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>max</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return an integer derived from the string <code>s</code>. The same string
+
always hashes to the same value, also between processes,
+
architectures, and Pike versions (see compatibility notes below,
+
though).</p>
+
<p> If <code>max</code> is given, the result will be >= 0 and < <code>max</code>,
+
otherwise the result will be >= 0 and <= 0x7fffffff.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The hash algorithm was changed in Pike 8.1. If you want a hash
+
that is compatible with Pike 8.0 and earlier, use <code>hash_8_0()</code>.</p>
+
<p> The hash algorithm was also changed in Pike 7.5. If you want a hash
+
that is compatible with Pike 7.4 and earlier, use <code>hash_7_4()</code>.
+
The difference with regards to <code>hash_8_0()</code> only affects wide strings.</p>
+
<p> The hash algorithm was also changed in Pike 7.1. If you want a hash
+
that is compatible with Pike 7.0 and earlier, use <code>hash_7_0()</code>.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This hash function differs from the one provided by <code>hash_value()</code>,
+
in that <code>hash_value()</code> returns a process specific value.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>hash_7_0()</code>, <code>hash_7_4()</code>, <code>hash_8_0()</code>, <code>hash_value</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>hash_7_0</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>hash_7_0</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>hash_7_0</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>max</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return an integer derived from the string <code>s</code>. The same string
+
always hashes to the same value, also between processes.</p>
+
<p> If <code>max</code> is given, the result will be >= 0 and < <code>max</code>,
+
otherwise the result will be >= 0 and <= 0x7fffffff.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function is provided for backward compatibility with
+
code written for Pike up and including version 7.0.</p>
+
<p> This function is not NUL-safe, and is byte-order dependant.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>hash()</code>, <code>hash_7_4</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>hash_7_4</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>hash_7_4</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>hash_7_4</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>max</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return an integer derived from the string <code>s</code>. The same string
+
always hashes to the same value, also between processes.</p>
+
<p> If <code>max</code> is given, the result will be >= 0 and < <code>max</code>,
+
otherwise the result will be >= 0 and <= 0x7fffffff.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function is provided for backward compatibility with
+
code written for Pike up and including version 7.4.</p>
+
<p> This function is byte-order dependant for wide strings.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>hash_7_6()</code>, <code>hash_7_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>hash_8_0</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>hash_8_0</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>hash_8_0</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>max</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return an integer derived from the string <code>s</code>. The same string
+
always hashes to the same value, also between processes,
+
architectures, and Pike versions (see compatibility notes below,
+
though).</p>
+
<p> If <code>max</code> is given, the result will be >= 0 and < <code>max</code>,
+
otherwise the result will be >= 0 and <= 0x7fffffff.</p>
+
</dd>
+
<dt class='head--doc'>Deprecated</dt>
+
<dd class='body--doc'><p>Use <code>hash_value()</code> for in-process hashing (eg, for implementing
+
<code>lfun::_hash()</code>) or one of the cryptographic hash functions.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function is really bad at hashing strings. Similar string
+
often return similar hash values.</p>
+
<p> It is especially bad for url:s, paths and similarly formatted
+
strings.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The hash algorithm was changed in Pike 7.5. If you want a hash
+
that is compatible with Pike 7.4 and earlier, use <code>hash_7_4()</code>.
+
The difference only affects wide strings.</p>
+
<p> The hash algorithm was also changed in Pike 7.1. If you want a hash
+
that is compatible with Pike 7.0 and earlier, use <code>hash_7_0()</code>.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This hash function differs from the one provided by <code>hash_value()</code>,
+
in that <code>hash_value()</code> returns a process specific value.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>hash()</code>, <code>hash_7_0()</code>, <code>hash_7_4()</code>, <code>hash_value</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>hash_value</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>hash_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>Return a hash value for the argument. It's an integer in the
+
native integer range.</p>
+
<p> The hash will be the same for the same value in the running
+
process only (the memory address is typically used as the basis
+
for the hash value).</p>
+
<p> If the value is an object with an <code>lfun::__hash</code>, that function
+
is called and its result returned.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This is the hashing method used by mappings.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>lfun::__hash()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>is_absolute_path</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>is_absolute_path</span>(</b><code class='datatype'>string</code> <code class='argument'>p</code><b>)</b></code></p></dd>
2142:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>localtime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>) <b><span class='method'>localtime</span>(</b><code class='datatype'>int</code> <code class='argument'>timestamp</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Convert seconds since 00:00:00 UTC, 1 Jan 1970 into components.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>This function returns a mapping with the following components:</p>
+
<table class='box'><tr><td><code><code class='key'>"sec"</code> : <code class='datatype'>int(0..60)</code></code></td><td><p>Seconds over the minute.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"min"</code> : <code class='datatype'>int(0..59)</code></code></td><td><p>Minutes over the hour.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"hour"</code> : <code class='datatype'>int(0..23)</code></code></td><td><p>Hour of the day.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"mday"</code> : <code class='datatype'>int(1..31)</code></code></td><td><p>Day of the month.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"mon"</code> : <code class='datatype'>int(0..11)</code></code></td><td><p>Month of the year.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"year"</code> : <code class='datatype'>int(0..)</code></code></td><td><p>Year since 1900.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"wday"</code> : <code class='datatype'>int(0..6)</code></code></td><td><p>Day of week (0 = Sunday).</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"yday"</code> : <code class='datatype'>int(0..365)</code></code></td><td><p>Day of the year.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"isdst"</code> : <code class='datatype'>bool</code></code></td><td><p>Is daylight-saving time active.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"timezone"</code> : <code class='datatype'>int</code></code></td><td><p>Offset from UTC, including daylight-saving time adjustment.</p>
+
</td></tr>
+
</table><p>An error is thrown if the localtime(2) call failed on the system.
+
It's platform dependent what time ranges that function can handle,
+
e.g. Windows doesn't handle a negative <code>timestamp</code>.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Prior to Pike 7.5 the field <code class='expr'>"timezone"</code> was sometimes not
+
present, and was sometimes not adjusted for daylight-saving time.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Calendar</code>, <code>gmtime()</code>, <code>time()</code>, <code>ctime()</code>, <code>mktime()</code>,
+
<code>strptime()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>log</b></span> </dt> <dd><p><code><code class='datatype'>float</code> <b><span class='method'>log</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>f</code><b>)</b></code></p></dd>
2158:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>lower_case</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>lower_case</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>lower_case</span>(</b><code class='datatype'>int</code> <code class='argument'>c</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Convert a string or character to lower case.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns a copy of the string <code>s</code> with all upper case characters
+
converted to lower case, or the character <code>c</code> converted to lower
+
case.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Assumes the string or character to be coded according to
+
ISO-10646 (aka Unicode). If they are not, <code>Charset.decoder</code> can
+
do the initial conversion for you.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Prior to Pike 7.5 this function only accepted strings.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>upper_case()</code>, <code>Charset.decoder</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>m_add</b></span> </dt> <dd><p><code><code class='datatype'>void</code> <b><span class='method'>m_add</span>(</b><code class='datatype'>multiset</code>|<code class='datatype'>object</code> <code class='argument'>l</code>, <code class='datatype'>mixed</code> <code class='argument'>val</code><b>)</b></code></p></dd>
2220:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>map</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>map</span>(</b><code class='datatype'>mixed</code> <code class='argument'>arr</code>, <code class='datatype'>void</code>|<code class='datatype'>mixed</code> <code class='argument'>fun</code>, <code class='datatype'>mixed</code> ... <code class='argument'>extra</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Applies <code>fun</code> to the elements in <code>arr</code> and collects the results.</p>
+
<p> <code>arr</code> is treated as a set of elements, as follows:</p>
+
<dl class='group--doc'><dt>array</dt>
+
<dt>multiset</dt>
+
<dt>string</dt>
+
<dd><p><code>fun</code> is applied in order to each element. The results are
+
collected, also in order, to a value of the same type as
+
<code>arr</code>, which is returned.</p>
+
</dd>
+
<dt>mapping</dt>
+
<dd><p><code>fun</code> is applied to the values, and each result is assigned
+
to the same index in a new mapping, which is returned.</p>
+
</dd>
+
<dt>program</dt>
+
<dd><p>The program is treated as a mapping containing the
+
identifiers that are indexable from it and their values.</p>
+
</dd>
+
<dt>object</dt>
+
<dd><p>If there is a <code>lfun::cast</code> method in the object, it's
+
called to try to cast the object to an array, a mapping, or
+
a multiset, in that order, which is then handled as
+
described above.</p>
+
</dd>
+
</dl><p><code>fun</code> is applied in different ways depending on its type:</p>
+
<dl class='group--doc'><dt>function</dt>
+
<dd><p><code>fun</code> is called for each element. It gets the current
+
element as the first argument and <code>extra</code> as the rest. The
+
result of the call is collected.</p>
+
</dd>
+
<dt>object</dt>
+
<dd><p><code>fun</code> is used as a function like above, i.e. the
+
<code>lfun::`()</code> method in it is called.</p>
+
</dd>
+
<dt>array</dt>
+
<dd><p>Each element of the <code>fun</code> array will be called for each
+
element of <code>arr</code>.</p>
+
</dd>
+
<dt>multiset</dt>
+
<dt>mapping</dt>
+
<dd><p><code>fun</code> is indexed with each element. The result of that is
+
collected.</p>
+
</dd>
+
<dt>"zero or left out"</dt>
+
<dd><p>Each element that is callable is called with <code>extra</code> as
+
arguments. The result of the calls are collected. Elements
+
that aren't callable gets zero as result.</p>
+
</dd>
+
<dt>string</dt>
+
<dd><p>Each element is indexed with the given string. If the result
+
of that is zero then a zero is collected, otherwise it's
+
called with <code>extra</code> as arguments and the result of that
+
call is collected.</p>
+
<p> This is typically used when <code>arr</code> is a collection of
+
objects, and <code>fun</code> is the name of some function in them.</p>
+
</dd>
+
</dl>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The function is never destructive on <code>arr</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>filter()</code>, <code>enumerate()</code>, <code>foreach()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>master</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>object</code> <b><span class='method'>master</span>(</b><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return the current master object.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>May return <code>UNDEFINED</code> if no master has been loaded yet.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>replace_master()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>max</b></span> </dt> <dd><p><code><code class='datatype'>int</code>|<code class='datatype'>float</code>|<code class='datatype'>object</code> <b><span class='method'>max</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code>|<code class='datatype'>object</code>, <code class='datatype'>int</code>|<code class='datatype'>float</code>|<code class='datatype'>object</code> ... <code class='argument'>args</code><b>)</b></code><br>
2289:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>mktime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>mktime</span>(</b><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>) <code class='argument'>tm</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>mktime</span>(</b><code class='datatype'>int</code> <code class='argument'>sec</code>, <code class='datatype'>int</code> <code class='argument'>min</code>, <code class='datatype'>int</code> <code class='argument'>hour</code>, <code class='datatype'>int</code> <code class='argument'>mday</code>, <code class='datatype'>int</code> <code class='argument'>mon</code>, <code class='datatype'>int</code> <code class='argument'>year</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>isdst</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>tz</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>This function converts information about date and time into an integer
+
which contains the number of seconds since 00:00:00 UTC, Jan 1, 1970.</p>
+
<p> You can either call this function with a mapping containing the
+
following elements:</p>
+
<table class='box'><tr><td><code><code class='key'>"sec"</code> : <code class='datatype'>int(0..60)</code></code></td><td><p>Seconds over the minute.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"min"</code> : <code class='datatype'>int(0..59)</code></code></td><td><p>Minutes over the hour.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"hour"</code> : <code class='datatype'>int(0..23)</code></code></td><td><p>Hour of the day.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"mday"</code> : <code class='datatype'>int(1..31)</code></code></td><td><p>Day of the month.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"mon"</code> : <code class='datatype'>int(0..11)</code></code></td><td><p>Month of the year.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"year"</code> : <code class='datatype'>int(0..)</code></code></td><td><p>Year since 1900.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"isdst"</code> : <code class='datatype'>int(-1..1)</code></code></td><td><p>Is daylight-saving time active. If omitted or set to <code class='expr'>-1</code>,
+
it means that the information is not available.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"timezone"</code> : <code class='datatype'>int</code></code></td><td><p>The timezone offset from UTC in seconds. If omitted, the time
+
will be calculated in the local timezone.</p>
+
</td></tr>
+
</table><p>Or you can just send them all on one line as the second syntax suggests.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>For proper UTC calculations ensure that <code class='expr'>isdst = 0</code> <b>and</b>
+
<code class='expr'>timezone = 0</code>; omitting either one of these parameters
+
<b>will</b> mess up the UTC calculation.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>On some operating systems (notably AIX and Win32), dates before
+
00:00:00 UTC, Jan 1, 1970 are not supported.</p>
+
<p> On most 32-bit systems, the supported range of dates is from Dec 13, 1901
+
20:45:52 UTC through to Jan 19, 2038 03:14:07 UTC (inclusive).</p>
+
<p> On most 64-bit systems, the supported range of dates is expressed
+
in 56 bits and is thus practically
+
unlimited (at least up to 1141 milion years in the past
+
and into the future).</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>time()</code>, <code>ctime()</code>, <code>localtime()</code>, <code>gmtime()</code>, <code>strftime()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>normalize_path</b></span> </dt> <dd><p><code><code class='datatype'>string</code> <b><span class='method'>normalize_path</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>
2317:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>object_variablep</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>bool</code> <b><span class='method'>object_variablep</span>(</b><code class='datatype'>object</code> <code class='argument'>o</code>, <code class='datatype'>string</code> <code class='argument'>var</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Find out if an object identifier is a variable.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>This function returns <code class='expr'>1</code> if <code>var</code> exists as a
+
non-protected variable in <code>o</code>, and returns <code class='expr'>0</code> (zero)
+
otherwise.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>indices()</code>, <code>values()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>objectp</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>objectp</span>(</b><code class='datatype'>mixed</code> <code class='argument'>arg</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if <code>arg</code> is an object, <code class='expr'>0</code> (zero) otherwise.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>mappingp()</code>, <code>programp()</code>, <code>arrayp()</code>, <code>stringp()</code>, <code>functionp()</code>,
+
<code>multisetp()</code>, <code>floatp()</code>, <code>intp()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>pow</b></span> </dt> <dd><p><code><code class='datatype'>int</code>|<code class='datatype'>float</code> <b><span class='method'>pow</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code> <code class='argument'>n</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code> <code class='argument'>x</code><b>)</b></code><br>
2359:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>query_num_arg</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>query_num_arg</span>(</b><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns the number of arguments given when the previous function was
+
called.</p>
+
<p> This is useful for functions that take a variable number of arguments.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>call_function()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>random</b></span> </dt> <dd><p><code><code class='datatype'>array</code> <b><span class='method'>random</span>(</b><code class='datatype'>mapping</code> <code class='argument'>m</code><b>)</b></code><br>
2378:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>random_seed</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>random_seed</span>(</b><code class='datatype'>int</code> <code class='argument'>seed</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>This function sets the initial value for the random generator.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>random()</code></p>
+
</dd>
+
<dt class='head--doc'>Deprecated</dt>
+
<dd class='body--doc'><p><code>Random.Deterministic</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>random_string</b></span> </dt> <dd><p><code><code class='datatype'>string</code> <b><span class='method'>random_string</span>(</b><code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd>
2454:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>replace</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>replace</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>string</code> <code class='argument'>from</code>, <code class='datatype'>string</code> <code class='argument'>to</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>replace</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <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='argument'>to</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>replace</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>from</code>, <code class='datatype'>string</code> <code class='argument'>to</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>replace</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>replacements</code><b>)</b></code><br>
+
<code><code class='datatype'>array</code> <b><span class='method'>replace</span>(</b><code class='datatype'>array</code> <code class='argument'>a</code>, <code class='datatype'>mixed</code> <code class='argument'>from</code>, <code class='datatype'>mixed</code> <code class='argument'>to</code><b>)</b></code><br>
+
<code><code class='datatype'>mapping</code> <b><span class='method'>replace</span>(</b><code class='datatype'>mapping</code> <code class='argument'>a</code>, <code class='datatype'>mixed</code> <code class='argument'>from</code>, <code class='datatype'>mixed</code> <code class='argument'>to</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Generic replace function.</p>
+
<p> This function can do several kinds replacement operations, the
+
different syntaxes do different things as follows:</p>
+
<p> If all the arguments are strings, a copy of <code>s</code> with every
+
occurrence of <code>from</code> replaced with <code>to</code> will be returned.
+
Special case: <code>to</code> will be inserted between every character in
+
<code>s</code> if <code>from</code> is the empty string.</p>
+
<p> If the first argument is a string, and the others array(string), a string
+
with every occurrance of <code>from</code>[<i>i</i>] in <code>s</code> replaced with
+
<code>to</code>[<i>i</i>] will be returned. Instead of the arrays <code>from</code> and <code>to</code>
+
a mapping equivalent to <code class='expr'><code>mkmapping</code>(<code>from</code>, <code>to</code>)</code> can be
+
used.</p>
+
<p> If the first argument is an array or mapping, the values of <code>a</code> which
+
are <code>`==()</code> with <code>from</code> will be replaced with <code>to</code> destructively.
+
<code>a</code> will then be returned.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Note that <code>replace()</code> on arrays and mappings is a destructive operation.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>replace_master</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>replace_master</span>(</b><code class='datatype'>object</code> <code class='argument'>o</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Replace the master object with <code>o</code>.</p>
+
<p> This will let you control many aspects of how Pike works, but beware that
+
<tt>master.pike</tt> may be required to fill certain functions, so it is
+
usually a good idea to have your master inherit the original master and
+
only re-define certain functions.</p>
+
<p> FIXME: Tell how to inherit the master.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>master()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>reverse</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>reverse</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'>start</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>end</code><b>)</b></code><br>
+
<code><code class='datatype'>array</code> <b><span class='method'>reverse</span>(</b><code class='datatype'>array</code> <code class='argument'>a</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><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>reverse</span>(</b><code class='datatype'>int</code> <code class='argument'>i</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><br>
+
<code><code class='datatype'>mixed</code> <b><span class='method'>reverse</span>(</b><code class='datatype'>object</code> <code class='argument'>o</code>, <code class='datatype'>mixed</code> ... <code class='argument'>options</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Reverses a string, array or int.</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>String to reverse.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-a'></span>Parameter <code class='parameter'>a</code></dt>
+
<dd></dd><dd class='body--doc'><p>Array to reverse.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-i'></span>Parameter <code class='parameter'>i</code></dt>
+
<dd></dd><dd class='body--doc'><p>Integer to reverse.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-o'></span>Parameter <code class='parameter'>o</code></dt>
+
<dd></dd><dd class='body--doc'><p>Object to reverse.</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>Optional start index of the range to reverse.
+
Default: <code class='expr'>0</code> (zero).</p>
+
</dd>
+
<dt class='head--doc'><span id='p-end'></span>Parameter <code class='parameter'>end</code></dt>
+
<dd></dd><dd class='body--doc'><p>Optional end index of the range to reverse.
+
Default for strings: <code class='expr'>sizeof(s)-1</code>.
+
Default for arrays: <code class='expr'>sizeof(a)-1</code>.
+
Default for integers: <code class='expr'>Pike.get_runtime_info()->int_size - 1</code>.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-options'></span>Parameter <code class='parameter'>options</code></dt>
+
<dd></dd><dd class='body--doc'><p>Optional arguments that are to be passed to <code>lfun::_reverse()</code>.</p>
+
<p> This function reverses a string, char by char, an array, value
+
by value or an int, bit by bit and returns the result. It's not
+
destructive on the input value. For objects it simply calls
+
<code>lfun::_reverse()</code> in the object, and returns the result.</p>
+
<p> Reversing strings can be particularly useful for parsing difficult
+
syntaxes which require scanning backwards.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>sscanf()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>round</b></span> </dt> <dd><p><code><code class='datatype'>float</code> <b><span class='method'>round</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>f</code><b>)</b></code></p></dd>
2473:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>rows</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>array</code> <b><span class='method'>rows</span>(</b><code class='datatype'>mixed</code> <code class='argument'>data</code>, <code class='datatype'>array</code> <code class='argument'>index</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Select a set of rows from an array.</p>
+
<p> This function is en optimized equivalent to:</p>
+
<pre><code>map<span class='delim'>(</span>index<span class='delim'>,</span> <span class='lang'>lambda</span><span class='delim'>(</span><span class='type'>mixed</span> x<span class='delim'>)</span> <span class='delim'>{</span> <span class='lang'>return</span> data<span class='delim'>[</span>x<span class='delim'>]</span><span class='delim'>;</span> <span class='delim'>}</span><span class='delim'>)</span>
+
</code></pre><p>That is, it indices data on every index in the array index and
+
returns an array with the results.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>column()</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>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>search</span>(</b><code class='datatype'>string</code> <code class='argument'>haystack</code>, <code class='datatype'>string</code>|<code class='datatype'>int</code> <code class='argument'>needle</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><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>search</span>(</b><code class='datatype'>array</code> <code class='argument'>haystack</code>, <code class='datatype'>mixed</code> <code class='argument'>needle</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><br>
+
<code><code class='datatype'>mixed</code> <b><span class='method'>search</span>(</b><code class='datatype'>mapping</code> <code class='argument'>haystack</code>, <code class='datatype'>mixed</code> <code class='argument'>needle</code>, <code class='datatype'>mixed</code>|<code class='datatype'>void</code> <code class='argument'>start</code><b>)</b></code><br>
+
<code><code class='datatype'>mixed</code> <b><span class='method'>search</span>(</b><code class='datatype'>object</code> <code class='argument'>haystack</code>, <code class='datatype'>mixed</code> <code class='argument'>needle</code>, <code class='datatype'>mixed</code>|<code class='datatype'>void</code> <code class='argument'>start</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>Search for <code>needle</code> in <code>haystack</code>.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-haystack'></span>Parameter <code class='parameter'>haystack</code></dt>
+
<dd></dd><dd class='body--doc'><p>Item to search in. This can be one of:</p>
+
<table class='box'><tr><td><code><code class='datatype'>string</code></code></td><td><p>When <code>haystack</code> is a string <code>needle</code> must be a string or an int,
+
and the first occurrence of the string or int is returned.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>array</code></code></td><td><p>When <code>haystack</code> is an array, <code>needle</code> is compared only to
+
one value at a time in <code>haystack</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>mapping</code></code></td><td><p>When <code>haystack</code> is a mapping, <code>search()</code> tries to find the index
+
connected to the data <code>needle</code>. That is, it tries to lookup the
+
mapping backwards.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>object</code></code></td><td><p>When <code>haystack</code> is an object implementing <code>lfun::_search()</code>,
+
the result of calling <code>lfun::_search()</code> with <code>needle</code>, <code>start</code>
+
and any <code>extra_args</code> will be returned.</p>
+
<p> If <code>haystack</code> is an object that doesn't implement <code>lfun::_search()</code>
+
it is assumed to be an <code>Iterator</code>, and implement
+
<code>Iterator()->index()</code>, <code>Iterator()->value()</code>, and
+
<code>Iterator()->next()</code>. <code>search()</code> will then start comparing
+
elements with <code>`==()</code> until a match with <code>needle</code> is found.
+
If <code>needle</code> is found <code>haystack</code> will be advanced to the element,
+
and the iterator index will be returned. If <code>needle</code> is not
+
found, <code>haystack</code> will be advanced to the end.</p>
+
</td></tr>
+
</table>
+
</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 the optional argument <code>start</code> is present search is started at
+
this position. This has no effect on mappings.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-end'></span>Parameter <code class='parameter'>end</code></dt>
+
<dd></dd><dd class='body--doc'><p>If the optional argument <code>end</code> is present, the search will terminate
+
at this position (exclusive) if not found earlier.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns the position of <code>needle</code> in <code>haystack</code> if found.</p>
+
<p> If not found the returned value depends on the type of <code>haystack</code>:</p>
+
<table class='box'><tr><td><code><code class='datatype'>string</code>|<code class='datatype'>array</code></code></td><td><p><code class='expr'>-1</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>mapping</code>|<code class='object unresolved'>Iterator</code></code></td><td><p><code>UNDEFINED</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>object</code></code></td><td><p>The value returned by <code>lfun::_search()</code>.</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>If <code>start</code> is supplied to an iterator object without an
+
<code>lfun::_search()</code>, <code>haystack</code> will need to implement
+
<code>Iterator()->set_index()</code>.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>For mappings and object <code>UNDEFINED</code> will be returned when not found.
+
In all other cases <code class='expr'>-1</code> will be returned when not found.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>indices()</code>, <code>values()</code>, <code>zero_type()</code>, <code>has_value()</code>,
+
<code>has_prefix()</code>, <code>has_suffix()</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_priority</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>set_priority</span>(</b><code class='datatype'>string</code> <code class='argument'>level</code>, <code class='datatype'>int(0..)</code>|<code class='datatype'>void</code> <code class='argument'>pid</code><b>)</b></code></p></dd>
2482:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>set_weak_flag</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>array</code>|<code class='datatype'>mapping</code>|<code class='datatype'>multiset</code> <b><span class='method'>set_weak_flag</span>(</b><code class='datatype'>array</code>|<code class='datatype'>mapping</code>|<code class='datatype'>multiset</code> <code class='argument'>m</code>, <code class='datatype'>int</code> <code class='argument'>state</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Set the value <code>m</code> to use weak or normal references in its
+
indices and/or values (whatever is applicable). <code>state</code> is a
+
bitfield built by using <code class='expr'>|</code> between the following flags:</p>
+
<table class='box'><tr><td><code><code class='key'>Pike.WEAK_INDICES</code></code></td><td><p>Use weak references for indices. Only applicable for
+
multisets and mappings.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>Pike.WEAK_VALUES</code></code></td><td><p>Use weak references for values. Only applicable for arrays
+
and mappings.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>Pike.WEAK</code></code></td><td><p>Shorthand for <code class='expr'>Pike.WEAK_INDICES|Pike.WEAK_VALUES</code>.</p>
+
</td></tr>
+
</table><p>If a flag is absent, the corresponding field will use normal
+
references. <code>state</code> can also be <code class='expr'>1</code> as a compatibility
+
measure; it's treated like <code>Pike.WEAK</code>.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p><code>m</code> will be returned.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>setxattr</b></span> </dt> <dd><p><code><code class='datatype'>void</code> <b><span class='method'>setxattr</span>(</b><code class='datatype'>string</code> <code class='argument'>file</code>, <code class='datatype'>string</code> <code class='argument'>attr</code>, <code class='datatype'>string</code> <code class='argument'>value</code>, <code class='datatype'>int</code> <code class='argument'>flags</code>, <code class='datatype'>void</code>|<code class='datatype'>bool</code> <code class='argument'>symlink</code><b>)</b></code></p></dd>
2649:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>sleep</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>sleep</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>s</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>abort_on_signal</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>This function makes the thread stop for <code>s</code> seconds.</p>
+
<p> Only signal handlers can interrupt the sleep, and only when
+
<code>abort_on_signal</code> is set. If more than one thread is running
+
the signal must be sent to the sleeping thread. Other callbacks
+
are not called during sleep.</p>
+
<p> If <code>s</code> is zero then this thread will yield to other threads but
+
not sleep otherwise. Note that Pike yields internally at regular
+
intervals so it's normally not necessary to do this.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>signal()</code>, <code>delay()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>sort</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>array</code> <b><span class='method'>sort</span>(</b><code class='datatype'>array</code>(<code class='datatype'>mixed</code>) <code class='argument'>index</code>, <code class='datatype'>array</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>Sort arrays destructively.</p>
+
<p> This function sorts the array <code>index</code> destructively. That means
+
that the array itself is changed and returned, no copy is created.</p>
+
<p> If extra arguments are given, they are supposed to be arrays of the
+
same size as <code>index</code>. Each of these arrays will be modified in the
+
same way as <code>index</code>. I.e. if index 3 is moved to position 0 in <code>index</code>
+
index 3 will be moved to position 0 in all the other arrays as well.</p>
+
<p> The sort order is as follows:</p>
+
<ul>
+
<li><p>Integers and floats are sorted in ascending order.</p>
+
</li><li><p>Strings are sorted primarily on the first characters that are
+
different, and secondarily with shorter strings before longer.
+
Different characters are sorted in ascending order on the
+
character value. Thus the sort order is not locale dependent.</p>
+
</li><li><p>Arrays are sorted recursively on the first element. Empty
+
arrays are sorted before nonempty ones.</p>
+
</li><li><p>Multisets are sorted recursively on the first index. Empty
+
multisets are sorted before nonempty ones.</p>
+
</li><li><p>Objects are sorted in ascending order according to <code>`<()</code>,
+
<code>`>()</code> and <code>`==()</code>.</p>
+
</li><li><p>Other types aren't reordered.</p>
+
</li><li><p>Different types are sorted in this order: Arrays, mappings,
+
multisets, objects, functions, programs, strings, types,
+
integers and floats. Note however that objects can control
+
their ordering wrt other types with <code>`<</code>, <code>`></code> and <code>`==</code>,
+
so this ordering of types only applies to objects without
+
those functions.</p>
+
</li></ul>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>The first argument is returned.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The sort is stable, i.e. elements that are compare-wise equal
+
aren't reordered.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Array.sort_array</code>, <code>reverse()</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> </dt> <dd><p><code><code class='datatype'>string</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>
3130:
<hr /> <dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>strftime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string(1..255)</code> <b><span class='method'>strftime</span>(</b><code class='datatype'>string(1..255)</code> <code class='argument'>format</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>) <code class='argument'>tm</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Convert the structure to a string.</p>
+
<dl class='group--doc'><dt>%a</dt>
+
<dd><p>The abbreviated weekday name according to the current locale</p>
+
</dd>
+
<dt>%A</dt>
+
<dd><p>The full weekday name according to the current locale.</p>
+
</dd>
+
<dt>%b</dt>
+
<dd><p>The abbreviated month name according to the current locale.</p>
+
</dd>
+
<dt>%B</dt>
+
<dd><p>The full month name according to the current locale.</p>
+
</dd>
+
<dt>%c</dt>
+
<dd><p>The preferred date and time representation for the current locale.</p>
+
</dd>
+
<dt>%C</dt>
+
<dd><p>The century number (year/100) as a 2-digit integer.</p>
+
</dd>
+
<dt>%d</dt>
+
<dd><p>The day of the month as a decimal number (range 01 to 31).</p>
+
</dd>
+
<dt>%D</dt>
+
<dd><p>Equivalent to <code class='expr'>%m/%d/%y</code>. (for Americans only.
+
Americans should note that in other countries <code class='expr'>%d/%m/%y</code>
+
is rather common. This means that in international context
+
this format is ambiguous and should not be used.)</p>
+
</dd>
+
<dt>%e</dt>
+
<dd><p>Like <code class='expr'>%d</code>, the day of the month as a decimal number,
+
but a leading zero is replaced by a space.</p>
+
</dd>
+
<dt>%E</dt>
+
<dd><p>Modifier: use alternative format, see below.</p>
+
</dd>
+
<dt>%F</dt>
+
<dd><p>Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99)</p>
+
</dd>
+
<dt>%G</dt>
+
<dd><p>The ISO 8601 week-based year (see NOTES) with century as a
+
decimal number. The 4-digit year corresponding to the ISO
+
week number (see <code class='expr'>%V</code>). This has the same format and
+
value as <code class='expr'>%Y</code>, except that if the ISO week number
+
belongs to the previous or next year, that year is used instead.</p>
+
</dd>
+
<dt>%g</dt>
+
<dd><p>Like <code class='expr'>%G</code>, but without century, that is,
+
with a 2-digit year (00-99). (TZ)</p>
+
</dd>
+
<dt>%h</dt>
+
<dd><p>Equivalent to %b.</p>
+
</dd>
+
<dt>%H</dt>
+
<dd><p>The hour as a decimal number using a 24-hour clock (range 00 to 23).</p>
+
</dd>
+
<dt>%I</dt>
+
<dd><p>The hour as a decimal number using a 12-hour clock (range 01 to 12).</p>
+
</dd>
+
<dt>%j</dt>
+
<dd><p>The day of the year as a decimal number (range 001 to 366).</p>
+
</dd>
+
<dt>%m</dt>
+
<dd><p>The month as a decimal number (range 01 to 12).</p>
+
</dd>
+
<dt>%M</dt>
+
<dd><p>The minute as a decimal number (range 00 to 59).</p>
+
</dd>
+
<dt>%n</dt>
+
<dd><p>A newline character. (SU)</p>
+
</dd>
+
<dt>%O</dt>
+
<dd><p>Modifier: use alternative format, see below. (SU)</p>
+
</dd>
+
<dt>%p</dt>
+
<dd><p>Either <code class='expr'>"AM"</code> or <code class='expr'>"PM"</code> according to the given time
+
value, or the corresponding strings for the current locale.
+
Noon is treated as <code class='expr'>"PM"</code> and midnight as <code class='expr'>"AM"</code>.</p>
+
</dd>
+
<dt>%P</dt>
+
<dd><p>Like <code class='expr'>%p</code> but in lowercase: <code class='expr'>"am"</code> or <code class='expr'>"pm"</code>
+
or a corresponding string for the current locale.</p>
+
</dd>
+
<dt>%r</dt>
+
<dd><p>The time in a.m. or p.m. notation. In the POSIX locale this is
+
equivalent to <code class='expr'>%I:%M:%S %p</code>.</p>
+
</dd>
+
<dt>%R</dt>
+
<dd><p>The time in 24-hour notation (<code class='expr'>%H:%M</code>). (SU)
+
For a version including the seconds, see <code class='expr'>%T</code> below.</p>
+
</dd>
+
<dt>%s</dt>
+
<dd><p>The number of seconds since the Epoch,
+
1970-01-01 00:00:00 +0000 (UTC). (TZ)</p>
+
</dd>
+
<dt>%S</dt>
+
<dd><p>The second as a decimal number (range 00 to 60).
+
(The range is up to 60 to allow for occasional leap seconds.)</p>
+
</dd>
+
<dt>%t</dt>
+
<dd><p>A tab character. (SU)</p>
+
</dd>
+
<dt>%T</dt>
+
<dd><p>The time in 24-hour notation (<code class='expr'>%H:%M:%S</code>). (SU)</p>
+
</dd>
+
<dt>%u</dt>
+
<dd><p>The day of the week as a decimal, range 1 to 7, Monday being 1.
+
See also <code class='expr'>%w</code>. (SU)</p>
+
</dd>
+
<dt>%U</dt>
+
<dd><p>The week number of the current year as a decimal number,
+
range 00 to 53, starting with the first Sunday as the first
+
day of week 01. See also <code class='expr'>%V</code> and <code class='expr'>%W</code>.</p>
+
</dd>
+
<dt>%V</dt>
+
<dd><p>The ISO 8601 week number of the current year as a decimal number,
+
range 01 to 53, where week 1 is the first week that has at least
+
4 days in the new year. See also <code class='expr'>%U</code> and <code class='expr'>%W</code>.</p>
+
</dd>
+
<dt>%w</dt>
+
<dd><p>The day of the week as a decimal, range 0 to 6, Sunday being 0.
+
See also <code class='expr'>%u</code>.</p>
+
</dd>
+
</dl>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>ctime()</code>, <code>mktime()</code>, <code>strptime()</code>, <code>Gettext.setlocale</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
<dt class='head--type'><span class='homogen--type'>Constant</span> <span class='homogen--name'><b>strict_sprintf_format</b></span> </dt>
3147:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>string_filter_non_unicode</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string(1..)</code> <b><span class='method'>string_filter_non_unicode</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>Replace the most obviously non-unicode characters from <code>s</code> with
+
the unicode replacement character.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This will replace characters outside the ranges
+
<code class='expr'>0x00000000-0x0000d7ff</code> and <code class='expr'>0x0000e000-0x0010ffff</code>
+
with 0xffea (the replacement character).</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Charset.encoder()</code>, <code>string_to_unicode()</code>,
+
<code>unicode_to_string()</code>, <code>utf8_to_string()</code>, <code>string_to_utf8()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>string_to_unicode</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string(8bit)</code> <b><span class='method'>string_to_unicode</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int(0..2)</code>|<code class='datatype'>void</code> <code class='argument'>byteorder</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Converts a string into an UTF16 compliant byte-stream.</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>String to convert to UTF16.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-byteorder'></span>Parameter <code class='parameter'>byteorder</code></dt>
+
<dd></dd><dd class='body--doc'><p>Byte-order for the output. One of:</p>
+
<table class='box'><tr><td><code><code class='key'>0</code></code></td><td><p>Network (aka big-endian) byte-order (default).</p>
+
</td></tr>
+
<tr><td><code><code class='key'>1</code></code></td><td><p>Little-endian byte-order.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>2</code></code></td><td><p>Native byte-order.</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Throws an error if characters not legal in an UTF16 stream are
+
encountered. Valid characters are in the range 0x00000 - 0x10ffff,
+
except for characters 0xfffe and 0xffff.</p>
+
<p> Characters in range 0x010000 - 0x10ffff are encoded using surrogates.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Charset.decoder()</code>, <code>string_to_utf8()</code>, <code>unicode_to_string()</code>,
+
<code>utf8_to_string()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>string_to_utf8</b></span>
+
</dt>
+
<dd><p><code><code class='object unresolved'>utf8_string</code> <b><span class='method'>string_to_utf8</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='object unresolved'>utf8_string</code> <b><span class='method'>string_to_utf8</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>extended</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Convert a string into a UTF-8 compliant byte-stream.</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>String to encode into UTF-8.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-extended'></span>Parameter <code class='parameter'>extended</code></dt>
+
<dd></dd><dd class='body--doc'><p>Bitmask with extension options.</p>
+
<table class='box'><tr><td><code><code class='key'>1</code></code></td><td><p>Accept and encode the characters outside the valid ranges
+
using the same algorithm. Such encoded characters are
+
however not UTF-8 compliant.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>2</code></code></td><td><p>Encode characters outside the BMP with UTF-8 encoded UTF-16
+
(ie split them into surrogate pairs and encode).</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Throws an error if characters not valid in an UTF-8 stream are
+
encountered. Valid characters are in the ranges
+
<code class='expr'>0x00000000-0x0000d7ff</code> and <code class='expr'>0x0000e000-0x0010ffff</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Charset.encoder()</code>, <code>string_to_unicode()</code>,
+
<code>unicode_to_string()</code>, <code>utf8_to_string()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>stringp</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>stringp</span>(</b><code class='datatype'>mixed</code> <code class='argument'>arg</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if <code>arg</code> is a string, <code class='expr'>0</code> (zero) otherwise.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>intp()</code>, <code>programp()</code>, <code>arrayp()</code>, <code>multisetp()</code>, <code>objectp()</code>,
+
<code>mappingp()</code>, <code>floatp()</code>, <code>functionp()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>strptime</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>) <b><span class='method'>strptime</span>(</b><code class='datatype'>string(1..255)</code> <code class='argument'>data</code>, <code class='datatype'>string(1..255)</code> <code class='argument'>format</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Parse the given <code>data</code> using the format in <code>format</code> as a date.</p>
+
<dl class='group--doc'><dt>%%</dt>
+
<dd><p>The % character.</p>
+
</dd>
+
<dt>%a or %A</dt>
+
<dd><p>The weekday name according to the C locale, in abbreviated
+
form or the full name.</p>
+
</dd>
+
<dt>%b or %B or %h</dt>
+
<dd><p>The month name according to the C locale, in abbreviated form
+
or the full name.</p>
+
</dd>
+
<dt>%c</dt>
+
<dd><p>The date and time representation for the C locale.</p>
+
</dd>
+
<dt>%C</dt>
+
<dd><p>The century number (0-99).</p>
+
</dd>
+
<dt>%d or %e</dt>
+
<dd><p>The day of month (1-31).</p>
+
</dd>
+
<dt>%D</dt>
+
<dd><p>Equivalent to %m/%d/%y.</p>
+
</dd>
+
<dt>%H</dt>
+
<dd><p>The hour (0-23).</p>
+
</dd>
+
<dt>%I</dt>
+
<dd><p>The hour on a 12-hour clock (1-12).</p>
+
</dd>
+
<dt>%j</dt>
+
<dd><p>The day number in the year (1-366).</p>
+
</dd>
+
<dt>%m</dt>
+
<dd><p>The month number (1-12).</p>
+
</dd>
+
<dt>%M</dt>
+
<dd><p>The minute (0-59).</p>
+
</dd>
+
<dt>%n</dt>
+
<dd><p>Arbitrary whitespace.</p>
+
</dd>
+
<dt>%p</dt>
+
<dd><p>The C locale's equivalent of AM or PM.</p>
+
</dd>
+
<dt>%R</dt>
+
<dd><p>Equivalent to %H:%M.</p>
+
</dd>
+
<dt>%S</dt>
+
<dd><p>The second (0-60; 60 may occur for leap seconds;
+
earlier also 61 was allowed).</p>
+
</dd>
+
<dt>%t</dt>
+
<dd><p>Arbitrary whitespace.</p>
+
</dd>
+
<dt>%T</dt>
+
<dd><p>Equivalent to %H:%M:%S.</p>
+
</dd>
+
<dt>%U</dt>
+
<dd><p>The week number with Sunday the first day of the week (0-53).</p>
+
</dd>
+
<dt>%w</dt>
+
<dd><p>The weekday number (0-6) with Sunday = 0.</p>
+
</dd>
+
<dt>%W</dt>
+
<dd><p>The week number with Monday the first day of the week (0-53).</p>
+
</dd>
+
<dt>%x</dt>
+
<dd><p>The date, using the C locale's date format.</p>
+
</dd>
+
<dt>%X</dt>
+
<dd><p>The time, using the C locale's time format.</p>
+
</dd>
+
<dt>%y</dt>
+
<dd><p>The year within century (0-99). When a century is not
+
otherwise specified, values in the range 69-99 refer to years
+
in the twentieth century (1969-1999); values in the range
+
00-68 refer to years in the twenty-first century (2000-2068).</p>
+
</dd>
+
<dt>%Y</dt>
+
<dd><p>The year, including century (for example, 1991).</p>
+
</dd>
+
</dl>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>localtime()</code>, <code>gmtime()</code>, <code>strftime()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>tan</b></span> </dt> <dd><p><code><code class='datatype'>float</code> <b><span class='method'>tan</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>f</code><b>)</b></code></p></dd>
3207:
<hr /> <dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>this_object</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>object</code> <b><span class='method'>this_object</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>level</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Returns the object we are currently evaluating in.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt>
+
<dd></dd><dd class='body--doc'><p><code>level</code> may be used to access the object of a surrounding
+
class: The object at level 0 is the current object, the object
+
at level 1 is the one belonging to the class that surrounds
+
the class that the object comes from, and so on.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>As opposed to a qualified <code class='expr'>this</code> reference such as
+
<code class='expr'>global::this</code>, this function doesn't always access the
+
objects belonging to the lexically surrounding classes. If the
+
class containing the call has been inherited then the objects
+
surrounding the inheriting class are accessed.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
<dt class='head--type'><span class='homogen--type'>Constant</span> <span class='homogen--name'><b>this_program</b></span> </dt>
3223:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>throw</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mixed</code>|<code class='datatype'>void</code> <b><span class='method'>throw</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>Throw <code>value</code> to a waiting <code>catch</code>.</p>
+
<p> If no <code>catch</code> is waiting the global error handling will send the
+
value to <code>master()->handle_error()</code>.</p>
+
<p> If you throw an array with where the first index contains an error
+
message and the second index is a backtrace, (the output from
+
<code>backtrace()</code>) then it will be treated exactly like a real error
+
by overlying functions.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>catch</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>time</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>time</span>(</b><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>time</span>(</b><code class='datatype'>int(1..1)</code> <code class='argument'>one</code><b>)</b></code><br>
+
<code><code class='datatype'>float</code> <b><span class='method'>time</span>(</b><code class='datatype'>int(2..)</code> <code class='argument'>t</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>This function returns the number of seconds since 00:00:00 UTC, 1 Jan 1970.</p>
+
<p> The second syntax does not query the system for the current
+
time, instead the last time value used by the pike process is returned
+
again. It avoids a system call, and thus is slightly faster,
+
but can be wildly inaccurate. Pike
+
queries the time internally when a thread has waited for
+
something, typically in <code>sleep</code> or in a backend (see
+
<code>Pike.Backend</code>).</p>
+
<p> The third syntax can be used to measure time more precisely than one
+
second. It returns how many seconds have passed since <code>t</code>. The precision
+
of this function varies from system to system.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>ctime()</code>, <code>localtime()</code>, <code>mktime()</code>, <code>gmtime()</code>,
+
<code>System.gettimeofday()</code>, <code>gethrtime()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>trace</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>trace</span>(</b><code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>facility</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>all_threads</code><b>)</b></code></p></dd>
3309:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>unicode_to_string</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>unicode_to_string</span>(</b><code class='datatype'>string(8bit)</code> <code class='argument'>s</code>, <code class='datatype'>int(0..2)</code>|<code class='datatype'>void</code> <code class='argument'>byteorder</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Converts an UTF16 byte-stream into a string.</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>String to convert to UTF16.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-byteorder'></span>Parameter <code class='parameter'>byteorder</code></dt>
+
<dd></dd><dd class='body--doc'><p>Default input byte-order. One of:</p>
+
<table class='box'><tr><td><code><code class='key'>0</code></code></td><td><p>Network (aka big-endian) byte-order (default).</p>
+
</td></tr>
+
<tr><td><code><code class='key'>1</code></code></td><td><p>Little-endian byte-order.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>2</code></code></td><td><p>Native byte-order.</p>
+
</td></tr>
+
</table><p>Note that this argument is disregarded if <code>s</code> starts with a BOM.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Charset.decoder()</code>, <code>string_to_unicode()</code>, <code>string_to_utf8()</code>,
+
<code>utf8_to_string()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>upper_case</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>upper_case</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>upper_case</span>(</b><code class='datatype'>int</code> <code class='argument'>c</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Convert a string or character to upper case.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns a copy of the string <code>s</code> with all lower case characters
+
converted to upper case, or the character <code>c</code> converted to upper
+
case.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Assumes the string or character to be coded according to
+
ISO-10646 (aka Unicode). If they are not, <code>Charset.decoder</code> can
+
do the initial conversion for you.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Prior to Pike 7.5 this function only accepted strings.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>lower_case()</code>, <code>Charset.decoder</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>utf8_to_string</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>utf8_to_string</span>(</b><code class='object unresolved'>utf8_string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>string</code> <b><span class='method'>utf8_to_string</span>(</b><code class='object unresolved'>utf8_string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>extended</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Converts an UTF-8 byte-stream into a string.</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>String of UTF-8 encoded data to decode.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-extended'></span>Parameter <code class='parameter'>extended</code></dt>
+
<dd></dd><dd class='body--doc'><p>Bitmask with extension options.</p>
+
<table class='box'><tr><td><code><code class='key'>1</code></code></td><td><p>Accept and decode the extension used by <code>string_to_utf8()</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>2</code></code></td><td><p>Accept and decode UTF-8 encoded UTF-16 (ie accept and
+
decode valid surrogates).</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Throws an error if the stream is not a legal UTF-8 byte-stream.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>In conformance with <b><a href='http://pike.lysator.liu.se/rfc3629.xml'>RFC 3629</a></b> and Unicode 3.1 and later,
+
non-shortest forms are not decoded. An error is thrown instead.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Charset.encoder()</code>, <code>string_to_unicode()</code>, <code>string_to_utf8()</code>,
+
<code>unicode_to_string()</code>, <code>validate_utf8()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>validate_utf8</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>bool</code> <b><span class='method'>validate_utf8</span>(</b><code class='object unresolved'>utf8_string</code> <code class='argument'>s</code><b>)</b></code><br>
+
<code><code class='datatype'>bool</code> <b><span class='method'>validate_utf8</span>(</b><code class='object unresolved'>utf8_string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>extended</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Checks whether a string is a valid UTF-8 byte-stream.</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>String of UTF-8 encoded data to validate.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-extended'></span>Parameter <code class='parameter'>extended</code></dt>
+
<dd></dd><dd class='body--doc'><p>Bitmask with extension options.</p>
+
<table class='box'><tr><td><code><code class='key'>1</code></code></td><td><p>Accept the extension used by <code>string_to_utf8()</code>, including
+
lone UTF-16 surrogates.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>2</code></code></td><td><p>Accept UTF-8 encoded UTF-16 (ie accept valid surrogate-pairs).</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>0</code> (zero) if the stream is not a legal
+
UTF-8 byte-stream, and <code class='expr'>1</code> if it is.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>In conformance with <b><a href='http://pike.lysator.liu.se/rfc3629.xml'>RFC 3629</a></b> and Unicode 3.1 and later,
+
non-shortest forms are considered invalid.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Charset.encoder()</code>, <code>string_to_unicode()</code>, <code>string_to_utf8()</code>,
+
<code>unicode_to_string()</code>, <code>utf8_to_string()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>version</b></span> </dt> <dd><p><code><code class='datatype'>string</code> <b><span class='method'>version</span>(</b><b>)</b></code></p></dd>
8210:
<dd class='body--doc'><p>Set the variable for the setter to <code>val</code>.</p> <p> This is the function returned by <code>_get_setter()</code>.</p> </dd></dl>
+
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Builtin.__master</b></h2>
+
</dt><dd><dl class='group--doc'>
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Used to prototype the master object.</p>
+
</dd></dl>
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>_main</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>_main</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>argv</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>env</code><b>)</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>cast_to_object</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>object</code> <b><span class='method'>cast_to_object</span>(</b><code class='datatype'>string</code> <code class='argument'>oname</code>, <code class='datatype'>string</code> <code class='argument'>current_file</code><b>)</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>cast_to_program</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>program</code> <b><span class='method'>cast_to_program</span>(</b><code class='datatype'>string</code> <code class='argument'>pname</code>, <code class='datatype'>string</code> <code class='argument'>current_file</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>handler</code><b>)</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>compile_error</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>compile_error</span>(</b><code class='datatype'>string</code> <code class='argument'>file</code>, <code class='datatype'>int</code> <code class='argument'>line</code>, <code class='datatype'>string</code> <code class='argument'>err</code><b>)</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>compile_warning</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>compile_warning</span>(</b><code class='datatype'>string</code> <code class='argument'>file</code>, <code class='datatype'>int</code> <code class='argument'>line</code>, <code class='datatype'>string</code> <code class='argument'>warn</code><b>)</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>decode_charset</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>decode_charset</span>(</b><code class='datatype'>string</code> <code class='argument'>data</code>, <code class='datatype'>string</code> <code class='argument'>charset</code><b>)</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>describe_backtrace</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>describe_backtrace</span>(</b><code class='datatype'>object</code>|<code class='datatype'>array</code> <code class='argument'>trace</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>line_width</code><b>)</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>handle_error</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>handle_error</span>(</b><code class='datatype'>array</code>|<code class='datatype'>object</code> <code class='argument'>trace</code><b>)</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>handle_import</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>handle_import</span>(</b><code class='datatype'>string</code> <code class='argument'>what</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>current_file</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>handler</code><b>)</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>handle_include</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>handle_include</span>(</b><code class='datatype'>string</code> <code class='argument'>f</code>, <code class='datatype'>string</code> <code class='argument'>current_file</code>, <code class='datatype'>bool</code> <code class='argument'>local_include</code><b>)</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>handle_inherit</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>program</code> <b><span class='method'>handle_inherit</span>(</b><code class='datatype'>string</code> <code class='argument'>pname</code>, <code class='datatype'>string</code> <code class='argument'>current_file</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>handler</code><b>)</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>read_include</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>read_include</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</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>resolv</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>resolv</span>(</b><code class='datatype'>string</code> <code class='argument'>identifier</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>current_file</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>handler</code><b>)</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>werror</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>werror</span>(</b><code class='datatype'>string</code> <code class='argument'>fmt</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</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>write</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>write</span>(</b><code class='datatype'>string</code> <code class='argument'>fmt</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd>
+
</dl>
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Builtin.automap_marker</b></h2> </dt><dd><dl class='group--doc'> <dt class='head--doc'>Description</dt>
15854:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>memory_usage</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>) <b><span class='method'>memory_usage</span>(</b><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Check memory usage.</p>
+
<p> This function is mostly intended for debugging. It delivers a mapping
+
with information about how many arrays/mappings/strings etc. there
+
are currently allocated and how much memory they use.</p>
+
<p> The entries in the mapping are typically paired, with one
+
named <code class='expr'>"num_" + SYMBOL + "s"</code> containing a count,
+
and the other named <code class='expr'>SYMBOL + "_bytes"</code> containing
+
a best effort approximation of the size in bytes.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Exactly what fields this function returns is version dependant.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>_verify_internals()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>next</b></span> </dt> <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>next</span>(</b><code class='datatype'>mixed</code> <code class='argument'>x</code><b>)</b></code></p></dd>
16006:
<dt class='head--doc'>Note</dt> <dd class='body--doc'><p>Only available when compiled with dmalloc.</p> </dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>size_object</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>size_object</span>(</b><code class='datatype'>object</code> <code class='argument'>o</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return the aproximate size of the object, in bytes.
+
This might not work very well for native objects</p>
+
<p> The function tries to estimate the memory usage of variables
+
belonging to the object.</p>
+
<p> It will not, however, include the size of objects assigned to
+
variables in the object.</p>
+
<p> If the object has a <code>lfun::_size_object()</code> it will be called
+
without arguments, and the return value will be added to the final
+
size. It is primarily intended to be used by C-objects that
+
allocate memory that is not normally visible to pike.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>lfun::_size_object()</code>, <code>sizeof()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>verify_internals</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>verify_internals</span>(</b><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Perform sanity checks.</p>
+
<p> This function goes through most of the internal Pike structures and
+
generates a fatal error if one of them is found to be out of order.
+
It is only used for debugging.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function does a more thorough check if the Pike runtime has
+
been compiled with RTL debug.</p>
+
</dd></dl>
<dl><dt><h2 class='header'>Class <b class='ms datatype'>Debug.Decoder</b></h2> </dt><dd>
30304:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>get_first_arg_type</b></span>
+
</dt>
+
<dd><p><code><code class='type'>type</code>|<code class='datatype'>zero</code> <b><span class='method'>get_first_arg_type</span>(</b><code class='type'>type</code> <code class='argument'>fun_type</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Check if a function of the type <code>fun_type</code> may be called
+
with an argument, and return the type of that argument.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns the expected type of the first argument to the function.</p>
+
<p> Returns <tt>0</tt> (zero) if a function of the type <code>fun_type</code>
+
may not be called with any argument, or if it is not callable.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>get_return_type</b></span>
+
</dt>
+
<dd><p><code><code class='type'>type</code>|<code class='datatype'>zero</code> <b><span class='method'>get_return_type</span>(</b><code class='type'>type</code> <code class='argument'>fun_type</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Check what a function of the type <code>fun_type</code> will
+
return if called with no arguments.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns the type of the returned value on success</p>
+
<p> Returns <tt>0</tt> (zero) on failure.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>get_runtime_info</b></span> </dt> <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'>get_runtime_info</span>(</b><b>)</b></code></p></dd>
30340:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>get_type_attributes</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>array</code>(<code class='datatype'>string</code>) <b><span class='method'>get_type_attributes</span>(</b><code class='type'>type</code> <code class='argument'>t</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Get the attribute markers for a type.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns an array with the attributes for the type <code>t</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>get_return_type()</code>, <code>get_first_arg_type()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>identify_cycle</b></span> </dt> <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>mixed</code>) <b><span class='method'>identify_cycle</span>(</b><code class='datatype'>mixed</code> <code class='argument'>x</code><b>)</b></code></p></dd>
30383:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>low_check_call</b></span>
+
</dt>
+
<dd><p><code><code class='type'>type</code>|<code class='datatype'>zero</code> <b><span class='method'>low_check_call</span>(</b><code class='type'>type</code> <code class='argument'>fun_type</code>, <code class='type'>type</code> <code class='argument'>arg_type</code><b>)</b></code><br>
+
<code><code class='type'>type</code>|<code class='datatype'>zero</code> <b><span class='method'>low_check_call</span>(</b><code class='type'>type</code> <code class='argument'>fun_type</code>, <code class='type'>type</code> <code class='argument'>arg_type</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>Check whether a function of type <code>fun_type</code> may be called
+
with a first argument of type <code>arg_type</code>.</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>The following flags are currently defined:</p>
+
<table class='box'><tr><td><code><code class='key'>1</code></code></td><td><p>Strict types. Fail if not all possible values in <code>arg_type</code>
+
are valid as the first argument to <code>fun_type</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>2</code></code></td><td><p>Last argument. <code>arg_type</code> is the last argument to <code>fun_type</code>.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>3</code></code></td><td><p>Both strict types and last argument as above.</p>
+
</td></tr>
+
</table>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns a continuation type on success.</p>
+
<p> Returns <tt>0</tt> (zero) on failure.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>soft_cast</b></span>
+
</dt>
+
<dd><p><code><code class='type'>type</code>|<code class='datatype'>zero</code> <b><span class='method'>soft_cast</span>(</b><code class='type'>type</code> <code class='argument'>to</code>, <code class='type'>type</code> <code class='argument'>from</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Return the resulting type from a soft cast of <code>from</code> to <code>to</code>.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>UNDEFINED</code> if the cast is invalid.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The return value for the invalid case may in the future
+
change to <code class='expr'>__unknown__</code>.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>yield</b></span> </dt> <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>yield</span>(</b><code class='datatype'>mixed</code> <code class='argument'>val</code><b>)</b></code></p></dd>