Branch: Tag:

2003-02-04

2003-02-04 23:58:40 by Martin Nilsson <mani@lysator.liu.se>

Added preprocessor chapter

Rev: refdoc/structure/traditional.xml:1.19

1:   <!doctype html><html><head><title>Pike Reference Manual</title>   <meta charset='utf-8'></head> - <body><dl><dt><h1 class='header'>9. Specific Datatype Modules</h1></dt><dd><dl><dt><h2 class='header'>Module <b class='ms datatype'>String</b></h2> - </dt><dd> + <body><dl><dt><h1 class='header'>9. I/O</h1></dt><dd><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.File</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>This is the basic I/O object, it provides socket communication as well +  as file access. It does not buffer reads and writes or provide line-by-line +  reading, that is done with <code>Stdio.FILE</code> object.</p> + </dd></dl>      <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>capitalize</b></span> + <span class='homogen--name'><b>assign</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>capitalize</span>(</b><code class='datatype'>string</code> <code class='argument'>str</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>assign</span>(</b><code class='object unresolved'>File</code>|<code class='object unresolved'>Fd</code> <code class='argument'>o</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Convert the first character in <code>str</code> to upper case, and return the -  new string.</p> + <dd class='body--doc'><p>This function takes a clone of Stdio.File and assigns all +  variables of this file from it. It can be used together with <code>dup()</code> +  to move files around.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>lower_case()</code>, <code>upper_case()</code></p> + <dd class='body--doc'><p><code>dup()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>common_prefix</b></span> + <span class='homogen--name'><b>async_connect</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>common_prefix</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>strs</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>async_connect</span>(</b><code class='datatype'>string</code> <code class='argument'>host</code>, <code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>mixed</code> ... :<code class='datatype'>void</code>) <code class='argument'>callback</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Find the longest common prefix from an array of strings.</p> + <dd class='body--doc'><p>Open a TCP/IP connection asynchronously.</p> + <p> This function is similar to <code>connect()</code>, but works asynchronously.</p> + </dd> + <dt class='head--doc'><span id='p-host'></span>Parameter <code class='parameter'>host</code></dt> + <dd></dd><dd class='body--doc'><p>Hostname or IP to connect to.</p> + </dd> + <dt class='head--doc'><span id='p-port'></span>Parameter <code class='parameter'>port</code></dt> + <dd></dd><dd class='body--doc'><p>Port number to connect to.</p> + </dd> + <dt class='head--doc'><span id='p-callback'></span>Parameter <code class='parameter'>callback</code></dt> + <dd></dd><dd class='body--doc'><p>Function to be called on completion. +  The first argument will be <tt>1</tt> if a connection was +  successfully estabished, and <tt>0</tt> (zero) on failure. +  The rest of the arguments to <code>callback</code> are passed +  verbatim from <code>args</code>.</p> + </dd> + <dt class='head--doc'><span id='p-args'></span>Parameter <code class='parameter'>args</code></dt> + <dd></dd><dd class='body--doc'><p>Extra arguments to pass to <code>callback</code>.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns <tt>0</tt> on failure, and <tt>1</tt> if <code>callback</code> +  will be used.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>The socket may be opened with <code>open_socket()</code> ahead of +  the call to this function, but it is not required.</p> + <p> For <code>callback</code> to be called, the backend must be active (ie +  <code>main()</code> must have returned <tt>-1</tt>).</p> + <p> The socket will be in non-blocking state if <tt>1</tt> has been +  returned, and any callbacks will be cleared.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>connect()</code>, <code>open_socket()</code>, <code>set_nonblocking()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>expand_tabs</b></span> + <span class='homogen--name'><b>close</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>expand_tabs</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>tab_width</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>substitute_tab</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>substitute_space</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>substitute_newline</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>close</span>(</b><b>)</b></code><br> + <code><code class='datatype'>int</code> <b><span class='method'>close</span>(</b><code class='datatype'>string</code> <code class='argument'>direction</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Expands tabs in a string to ordinary spaces, according to common -  tabulation rules.</p> + <dd class='body--doc'><p>Close the file. Optionally, specify "r", "w" or "rw" to close just +  the read, just the write or both read and write directions of the file +  respectively.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function will not call the <tt>close_callback</tt>.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>open</code>, <code>open_socket</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>fuzzymatch</b></span> + <span class='homogen--name'><b>connect</b></span>   </dt> - <dd><p><code><code class='datatype'>int(0..100)</code> <b><span class='method'>fuzzymatch</span>(</b><code class='datatype'>string</code> <code class='argument'>a</code>, <code class='datatype'>string</code> <code class='argument'>b</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>connect</span>(</b><code class='datatype'>string</code> <code class='argument'>host</code>, <code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>client</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>client_port</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This function compares two strings using a fuzzy matching -  routine. The higher the resulting value, the better the strings match.</p> + <dd class='body--doc'><p>This function connects a socket previously created with +  <code>open_socket()</code> to a remote socket through TCP/IP. The +  <code>host</code> argument is the hostname or IP number of the remote machine. +  A local IP and port can be explicitly bound by specifying <code>client</code> +  and <code>client_port</code>.</p>   </dd> -  + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>This function returns 1 for success, 0 otherwise.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>In nonblocking mode <tt>0</tt> (zero) may be returned and <code>errno()</code> set to +  <tt>EWOULDBLOCK</tt> or <tt>WSAEWOULDBLOCK</tt>. This should not be regarded +  as a connection failure. In nonblocking mode you need to wait for a write +  or close callback before you know if the connection failed or not.</p> + </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>Array.diff()</code>, <code>Array.diff_compare_table()</code> -  <code>Array.diff_longest_sequence()</code></p> + <dd class='body--doc'><p><code>query_address()</code>, <code>async_connect()</code>, <code>connect_unix()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>implode_nicely</b></span> + <span class='homogen--name'><b>connect_unix</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>implode_nicely</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>|<code class='datatype'>int</code>|<code class='datatype'>float</code>) <code class='argument'>foo</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>separator</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>connect_unix</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This function implodes a list of words to a readable string, e.g. -  ({"straw","berry","pie"}) becomes "straw, berry and pie". -  If the separator is omitted, the default is <tt>"and"</tt>. -  If the words are numbers they are converted to strings first.</p> + <dd class='body--doc'><p>Open a UNIX domain socket connection to the specified destination.</p>   </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>`*()</code></p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns <tt>1</tt> on success, and <tt>0</tt> on failure.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>Nonblocking mode is not supported while connecting</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>int2roman</b></span> + <span class='homogen--name'><b>create</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>int2roman</span>(</b><code class='datatype'>int</code> <code class='argument'>m</code><b>)</b></code></p></dd> + <dd><p><code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><b>)</b></code><br> + <code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>string</code> <code class='argument'>filename</code><b>)</b></code><br> + <code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><b>)</b></code><br> + <code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code>, <code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code><br> + <code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>string</code> <code class='argument'>descriptorname</code><b>)</b></code><br> + <code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>int</code> <code class='argument'>fd</code><b>)</b></code><br> + <code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>int</code> <code class='argument'>fd</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Converts the provided integer to a roman integer (i.e. a string).</p> + <dd class='body--doc'><p>There are four basic ways to create a Stdio.File object. +  The first is calling it without any arguments, in which case the you'd +  have to call <code>open()</code>, <code>connect()</code> or some other method which connects +  the File object with a stream.</p> + <p> The second way is calling it with a <code>filename</code> and open <code>mode</code>. This is +  the same thing as cloning and then calling <code>open()</code>, except shorter and +  faster.</p> + <p> The third way is to call it with <code>descriptorname</code> of <tt>"stdin"</tt>, +  <tt>"stdout"</tt> or <tt>"stderr"</tt>. This will open the specified +  standard stream.</p> + <p> For the advanced users, you can use the file descriptors of the +  systems (note: emulated by pike on some systems - like NT). This is +  only useful for streaming purposes on unix systems. This is <b>not +  recommended at all</b> if you don't know what you're into. Default +  <code>mode</code> for this is <tt>"rw"</tt>.</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p>Throws an error if <code>m</code> is outside the range 0 to 10000.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>Open mode will be filtered through the system UMASK. You +  might need to use <code>chmod()</code> later.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>open()</code>, <code>connect()</code>, <code>Stdio.FILE</code>,</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>int2size</b></span> + <span class='homogen--name'><b>dup</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>int2size</span>(</b><code class='datatype'>int</code> <code class='argument'>size</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>File</code> <b><span class='method'>dup</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the size as a memory size string with suffix, -  e.g. 43210 is converted into "42.2 kb". To be correct -  to the latest standards it should really read "42.2 KiB", -  but we have chosen to keep the old notation for a while. -  The function knows about the quantifiers kilo, mega, giga, -  tera, peta, exa, zetta and yotta.</p> + <dd class='body--doc'><p>This function returns a clone of Stdio.File with all variables +  copied from this file.</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p>Throws an error is <code>size</code> is less than zero.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>All variables, even <tt>id</tt>, are copied.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>assign()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>sillycaps</b></span> + <span class='homogen--name'><b>errno</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>sillycaps</span>(</b><code class='datatype'>string</code> <code class='argument'>str</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>errno</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Convert the first character in each word (separated by spaces) in -  <code>str</code> to upper case, and return the new string.</p> + <dd class='body--doc'><p>Returns the error code for the last command on this file. +  Error code is normally cleared when a command is successful.</p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>soundex</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>Fd_ref</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>soundex</span>(</b><code class='datatype'>string</code> <code class='argument'>word</code><b>)</b></code></p></dd> + <dd><p><code><span class='datatype'><code class='modifier'>optional</code> inherit Fd_ref</span> : <span class='inherit'>Fd_ref</span></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the soundex value of <code>word</code> according to -  the original Soundex algorithm, patented by Margaret O┬┤Dell -  and Robert C. Russel in 1918. The method is based on the phonetic -  classification of sounds by how they are made. It was only intended -  for hashing of english surnames, and even at that it isn't that -  much of a help.</p> - </dd></dl> - <dl><dt><h2 class='header'>Class <b class='ms datatype'>String.SplitIterator</b></h2> - </dt><dd> +       <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>line_iterator</b></span>   </dt> - <dd><p><code><span class='object'>String.SplitIterator</span> <span class='class'>String.SplitIterator</span><b>(</b><code class='datatype'>string</code> <code class='argument'>buffer</code>, <code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>)|<code class='datatype'>multiset</code>(<code class='datatype'>int</code>) <code class='argument'>split_set</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>flags</code>, <code class='datatype'>function</code>(:<code class='datatype'>string</code>)|<code class='datatype'>void</code> <code class='argument'>feed</code><b>)</b></code></p></dd> - </dl> - </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>String.Elite</b></h2> - </dt><dd> + <dd><p><code><code class='datatype'>object</code> <b><span class='method'>line_iterator</span>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>trim</code><b>)</b></code></p></dd>    -  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Returns an iterator that will loop over the lines in this file. +  If trim is true, all '\r' characters will be removed from the +  input.</p> + </dd></dl> +  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>elite_string</b></span> + <span class='homogen--name'><b>open</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>elite_string</span>(</b><code class='datatype'>string</code> <code class='argument'>in</code>, <code class='datatype'>void</code>|<code class='datatype'>int(0..100)</code> <code class='argument'>leetp</code>, <code class='datatype'>void</code>|<code class='datatype'>bool</code> <code class='argument'>eightbit</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>open</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><b>)</b></code><br> + <code><code class='datatype'>int</code> <b><span class='method'>open</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code>, <code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Translates a string to 1337. The optional -  argument leetp is the maximum percentage of -  leetness (100=max leet, 0=no leet).</p> - <p> The translation is performed in three steps, -  first the neccesary elite translations (picture -&gt; pic, -  cool-&gt;kewl etc), then optional translations -  (ok-&gt;k, dude-&gt;dood, -ers -&gt; -orz), then -  calls elite_word on the resulting words.</p> + <dd class='body--doc'><p>Open a file for read, write or append. The parameter <code>mode</code> should +  contain one or more of the following letters:</p> + <table class='box'><tr><td><code><code class='key'>'r'</code></code></td><td><p>Open file for reading.</p> + </td></tr> + <tr><td><code><code class='key'>'w'</code></code></td><td><p>Open file for writing.</p> + </td></tr> + <tr><td><code><code class='key'>'a'</code></code></td><td><p>Open file for append (use with <tt>'w'</tt>).</p> + </td></tr> + <tr><td><code><code class='key'>'t'</code></code></td><td><p>Truncate file at open (use with <tt>'w'</tt>).</p> + </td></tr> + <tr><td><code><code class='key'>'c'</code></code></td><td><p>Create file if it doesn't exist (use with <tt>'w'</tt>).</p> + </td></tr> + <tr><td><code><code class='key'>'x'</code></code></td><td><p>Fail if file already exists (use with <tt>'c'</tt>).</p> + </td></tr> + </table><p><code>mode</code> should always contain at least one of the letters <tt>'r'</tt> or +  <tt>'w'</tt>.</p> + <p> The parameter <code>mask</code> is protection bits to use if the file is created. +  Default is <tt>0666</tt> (read+write for all in octal notation).</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>This function returns 1 for success, 0 otherwise.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>close()</code>, <code>create()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>elite_word</b></span> + <span class='homogen--name'><b>open_socket</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>elite_word</span>(</b><code class='datatype'>string</code> <code class='argument'>in</code>, <code class='datatype'>void</code>|<code class='datatype'>int(0..100)</code> <code class='argument'>leetp</code>, <code class='datatype'>void</code>|<code class='datatype'>int(0..2)</code> <code class='argument'>eightbit</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>open_socket</span>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>port</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>address</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Translates one word to 1337. The optional -  argument leetp is the maximum percentage of -  leetness (100=max leet, 0=no leet). -  elite_word only do character-based translation, -  for instance from "k" to "|&lt;", but no language -  translation (no "cool" to "kewl").</p> + <dd class='body--doc'><p>This makes this file into a socket ready for connections. The reason +  for this function is so that you can set the socket to nonblocking +  or blocking (default is blocking) before you call <code>connect()</code>.</p> + <p> If you give a <code>port</code> number to this function, the socket will be +  bound to this <code>port</code> locally before connecting anywhere. This is +  only useful for some silly protocols like <b>FTP</b>. You may also +  specify an <code>address</code> to bind to if your machine has many IP numbers.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>This function returns 1 for success, 0 otherwise.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>connect()</code>, <code>set_nonblocking()</code>, <code>set_blocking()</code></p>   </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>String.HTML</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Functions that helps generating HTML. All functions generates -  HTML that is XHTML compliant as well as backwards compatible -  with old HTML standards in what extent is possible.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>pad_rows</b></span> + <span class='homogen--name'><b>pipe</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>string</code>)) <b><span class='method'>pad_rows</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>string</code>)) <code class='argument'>rows</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>padding</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>File</code> <b><span class='method'>pipe</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>how</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Pads out the rows in a array of rows to equal length. The new elements in -  the rows will have the value provided in <code>padding</code>, or "&amp;nbsp;".</p> + <dd class='body--doc'><p>This function creates a bi-directional pipe between the object it +  was called in and an object that is returned. The two ends of the +  pipe are indistinguishable. If the File object this function is +  called in was open to begin with, it will be closed before the pipe +  is created.</p> + </dd><dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document the <tt>PROP_</tt> properties.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Process.create_process()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>select</b></span> + <span class='homogen--name'><b>query_close_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>select</span>(</b><code class='datatype'>string</code> <code class='argument'>name</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>string</code>)) <code class='argument'>choices</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>selected</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <b><span class='method'>query_close_callback</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Creates an HTML select list.</p> + <dd class='body--doc'><p>This function returns the <tt>close_callback</tt>, which has been set with +  <code>set_nonblocking()</code> or <code>set_close_callback()</code>.</p>   </dd> - <dt class='head--doc'><span id='p-name'></span>Parameter <code class='parameter'>name</code></dt> - <dd></dd><dd class='body--doc'><p>The name of the select list. Will be used in the name attribute -  of the select element.</p> - </dd> - <dt class='head--doc'><span id='p-choices'></span>Parameter <code class='parameter'>choices</code></dt> - <dd></dd><dd class='body--doc'><p>May either be an array of strings, where each string is a choice, -  or an array of pairs. A pair is an array with two strings. The -  first string is the value of the choice while the second string -  is the presentation text associated with the value.</p> - </dd> - <dt class='head--doc'><span id='p-selected'></span>Parameter <code class='parameter'>selected</code></dt> - <dd></dd><dd class='body--doc'><p>The value that should be selected by default, if any.</p> - </dd> - <dt class='head--doc'>Example</dt> - <dd class='example'><pre><p>select("language", -  ({ ({ "eng", "English" }), -  ({ "swe", "Swedish" }), -  ({ "nor", "Norwegian" }) }), -  "swe");</p> - </pre></dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>set_close_callback()</code></p> + </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>simple_obox</b></span> + <span class='homogen--name'><b>query_id</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>simple_obox</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>string</code>)) <code class='argument'>rows</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>frame_color</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>cell_color</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>width</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>padding</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>int</code>, <code class='datatype'>string</code>, <code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>cell_callback</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>query_id</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This function should solve most of the obox needs that arises. It creates a table out -  of the array of arrays of strings fed into it. The tables will (with default settings) -  have a thin black outline around the table and between its cells. Much effort has gone -  into finding a simple HTML reresentation of such obox that is rendered in a similar way -  in all popular browsers. The current implementation has been tested against IE, Netscape, -  Mozilla, Opera and Konquest.</p> + <dd class='body--doc'><p>This function returns the <tt>id</tt> that has been set with <code>set_id()</code>.</p>   </dd> - <dt class='head--doc'><span id='p-rows'></span>Parameter <code class='parameter'>rows</code></dt> - <dd></dd><dd class='body--doc'><p>Simply an array of arrays with strings. The strings are the values that should appear -  in the table cells. All rows should have equal number of cells, otherwise the result -  will not be very eye pleasing.</p> - </dd> - <dt class='head--doc'><span id='p-frame_color'></span>Parameter <code class='parameter'>frame_color</code></dt> - <dd></dd><dd class='body--doc'><p>The color of the surrounding frame. Defaults to "#000000".</p> - </dd> - <dt class='head--doc'><span id='p-cell_color'></span>Parameter <code class='parameter'>cell_color</code></dt> - <dd></dd><dd class='body--doc'><p>The background color of the cells. Defaults to "#ffffff".</p> - </dd> - <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> - <dd></dd><dd class='body--doc'><p>The border width. Defaults to "1".</p> - </dd> - <dt class='head--doc'><span id='p-padding'></span>Parameter <code class='parameter'>padding</code></dt> - <dd></dd><dd class='body--doc'><p>The amount of padding in each cell. Defaults to "3".</p> - </dd> - <dt class='head--doc'><span id='p-cell_callback'></span>Parameter <code class='parameter'>cell_callback</code></dt> - <dd></dd><dd class='body--doc'><p>If provided, the cell callback will be called for each cell. As in parameters it -  will get the current x and y coordinates in the table. The upper left cell is 0,0. -  In addition to the coordinates it will also recieve the background color and the -  contents of the current cell. It is expected to return a td-element.</p> - </dd> - <dt class='head--doc'>Example</dt> - <dd class='example'><pre><p>function cb = lambda(int x, int y, string bgcolor, string contents) { -  if(y%2) return "&lt;td bgcolor='#aaaaff'&gt;"+contents+"&lt;/td&gt;"; -  return "&lt;td bgcolor='"+bgcolor+"'&gt;"+contents+"&lt;/td&gt;"; -  } -  simple_obox(my_rows, "#0000a0", 0, "1", "3", cb);</p> - </pre></dd> +    <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p>pad_rows</p> + <dd class='body--doc'><p><code>set_id()</code></p>   </dd></dl> - <dl><dt><h2 class='header'>Class <b class='ms datatype'>String.HTML.OBox</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Provides the same functionality as the <code>simple_obox</code> function, -  in a "streaming" way. The real gain is different addtition methods -  as well as the possibility to change the cell callback at any time.</p> - </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p>simple_obox</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>add_cell</b></span> + <span class='homogen--name'><b>query_read_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_cell</span>(</b><code class='datatype'>string</code> <code class='argument'>contents</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <b><span class='method'>query_read_callback</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Adds a cell with the provided content.</p> + <dd class='body--doc'><p>This function returns the <tt>read_callback</tt>, which has been set with +  <code>set_nonblocking()</code> or <code>set_read_callback()</code>.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>set_read_callback</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>add_raw_cell</b></span> + <span class='homogen--name'><b>query_read_oob_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_raw_cell</span>(</b><code class='datatype'>string</code> <code class='argument'>cell</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Adds this cell to the table unmodified, e.g. it should have an enclosing -  td or th element.</p> + <dd><p><code><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <b><span class='method'>query_read_oob_callback</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>add_row</b></span> + <span class='homogen--name'><b>query_write_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_row</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>cells</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <b><span class='method'>query_write_callback</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Adds a complete row. If the current row is nonempty a -  new row will be started.</p> + <dd class='body--doc'><p>This function returns the <tt>write_callback</tt>, which has been set with +  <code>set_nonblocking()</code> or <code>set_write_callback()</code>.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>set_write_callback</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_tagdata_cell</b></span> + <span class='homogen--name'><b>query_write_oob_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_tagdata_cell</span>(</b><code class='datatype'>string</code> <code class='argument'>tag</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>args</code>, <code class='datatype'>string</code> <code class='argument'>contents</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Creates a cell from the provided arguments and adds it to the table.</p> - </dd> - <dt class='head--doc'><span id='p-tag'></span>Parameter <code class='parameter'>tag</code></dt> - <dd></dd><dd class='body--doc'><p>The name of the element that should be produces. Typically -  "td" or "th".</p> - </dd> - <dt class='head--doc'><span id='p-args'></span>Parameter <code class='parameter'>args</code></dt> - <dd></dd><dd class='body--doc'><p>A mapping with the elements attributes.</p> - </dd> - <dt class='head--doc'><span id='p-contents'></span>Parameter <code class='parameter'>contents</code></dt> - <dd></dd><dd class='body--doc'><p>The element contents.</p> + <dd><p><code><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <b><span class='method'>query_write_oob_callback</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>cast</b></span> + <span class='homogen--name'><b>read_function</b></span>   </dt> - <dd><p><code><b>(</b><span class='datatype'>int</span><b>)</b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>float</span><b>)</b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>string</span><b>)</b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>array</span><b>)</b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>mapping</span><b>)</b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>multiset</span><b>)</b><span class='class'>String.HTML.OBox</span>()</code></p></dd> + <dd><p><code><code class='datatype'>function</code>(:<code class='datatype'>string</code>) <b><span class='method'>read_function</span>(</b><code class='datatype'>int</code> <code class='argument'>nbytes</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>It is possible to case this object to a string, which does the same -  as calling <code>render</code>, and to an array, which returns the cells in an -  array of rows.</p> + <dd class='body--doc'><p>Returns a function that when called will call <code>read</code> with +  nbytes as argument. Can be used to get various callback +  functions, as an example the fourth argument to +  String.SplitIterator.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>set_blocking</b></span>   </dt> - <dd><p><code><span class='object'>String.HTML.OBox</span> <span class='class'>String.HTML.OBox</span><b>(</b><code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>frame_color</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>cell_color</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>width</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>padding</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>int</code>, <code class='datatype'>string</code>, <code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>cell_callback</code><b>)</b></code></p></dd> - </dl> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_blocking</span>(</b><b>)</b></code></p></dd>    -  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>This function sets a stream to blocking mode. i.e. all reads and writes +  will wait until data has been transferred before returning.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_nonblocking()</code></p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>new_row</b></span> + <span class='homogen--name'><b>set_nonblocking_keep_callbacks</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>set_blocking_keep_callbacks</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>new_row</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_nonblocking_keep_callbacks</span>(</b><b>)</b></code><br> + <code><code class='datatype'>void</code> <b><span class='method'>set_blocking_keep_callbacks</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Begin a new row. Succeeding cells will be added to this -  row instead of the current.</p> + <dd class='body--doc'><p>toggle between blocking and nonblocking, +  without changing the callbacks</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>pad_rows</b></span> + <span class='homogen--name'><b>set_close_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>pad_rows</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_close_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>close_cb</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Ensures that all rows have the same number of cells.</p> + <dd class='body--doc'><p>This function sets the <tt>close_callback</tt> for the file. The +  <tt>close callback</tt> is called when the remote end of a socket or +  pipe is closed.</p> + <p> The callback is called with the <tt>id</tt> of the file as argument.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function does not set the file nonblocking.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>close</code> +  <code>query_close_callback()</code>, <code>set_read_callback()</code>, +  <code>set_write_callback()</code>, <code>set_id()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>render</b></span> + <span class='homogen--name'><b>set_id</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>render</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_id</span>(</b><code class='datatype'>mixed</code> <code class='argument'>id</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the result.</p> + <dd class='body--doc'><p>This function sets the <tt>id</tt> of this file. The <tt>id</tt> is mainly +  used as an identifier that is sent as the first argument to all +  callbacks. The default <tt>id</tt> is <tt>0</tt> (zero). Another possible +  use of the <tt>id</tt> is to hold all data related to this file in a +  mapping or array.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>query_id()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>set_cell_callback</b></span> + <span class='homogen--name'><b>set_nonblocking</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_cell_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>int</code>, <code class='datatype'>string</code>, <code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>cell_callback</code><b>)</b></code></p></dd> - </dl> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_nonblocking</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <code class='argument'>read_callback</code>, <code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>write_callback</code>, <code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>close_callback</code><b>)</b></code><br> + <code><code class='datatype'>void</code> <b><span class='method'>set_nonblocking</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <code class='argument'>read_callback</code>, <code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>write_callback</code>, <code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>close_callback</code>, <code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <code class='argument'>read_oob_callback</code>, <code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>write_oob_callback</code><b>)</b></code><br> + <code><code class='datatype'>void</code> <b><span class='method'>set_nonblocking</span>(</b><b>)</b></code></p></dd>    -  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>This function sets a stream to nonblocking mode. When data arrives on +  the stream, <code>read_callback</code> will be called with some or all of this +  data. When the stream has buffer space over for writing, +  <code>write_callback</code> will be called so that you can write more data to it. +  If the stream is closed at the other end, <code>close_callback</code> will be +  called. </p> + <p> When out-of-band data arrives on the stream, <code>read_oob_callback</code> will +  be called with some or all of this data. When the stream allows +  out-of-band data to be sent, <code>write_oob_callback</code> will be called so that +  you can write out-of-band data to it.</p> + <p> All callbacks will have the <tt>id</tt> of file as first argument when called +  (see <code>set_id()</code>).</p> + <p> If no arguments are given, the callbacks will not be changed. The +  stream will just be set to nonblocking mode.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>Out-of-band data will note be supported if Pike was compiled with the +  option <tt>'--without-oob'</tt>.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_blocking()</code>, <code>set_id()</code>, <code>set_read_callback()</code>, +  <code>set_write_callback()</code>, <code>set_close_callback()</code></p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>set_extra_args</b></span> + <span class='homogen--name'><b>set_read_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_extra_args</span>(</b><code class='datatype'>array</code>(<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>)) <code class='argument'>extra_args</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_read_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <code class='argument'>read_cb</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The argument in the mappings will be added to the cell in the -  cooresponding column of the table.</p> + <dd class='body--doc'><p>This function sets the <tt>read_callback</tt> for the file. The +  <tt>read_callback</tt> is called whenever there is data to read from +  the file.</p> + <p> The callback is called with the <tt>id</tt> of the file as first argument and +  some or all of its data as second.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function does not set the file nonblocking.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>read()</code>, +  <code>query_read_callback()</code>, <code>set_write_callback()</code>, +  <code>set_close_callback()</code>, <code>set_read_oob_callback</code> +  <code>set_write_oob_callback()</code>, <code>set_id()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>set_extra_args</b></span> + <span class='homogen--name'><b>set_read_oob_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_extra_args</span>(</b><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>extra_args</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The argument in the mapping will be added to all created table cells.</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_read_oob_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <code class='argument'>read_oob_cb</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p>   </dd></dl> - </dd></dl></dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Array</b></h2> - </dt><dd> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>arrayify</b></span> + <span class='homogen--name'><b>set_write_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>arrayify</span>(</b><code class='datatype'>void</code>|<code class='datatype'>array</code>|<code class='datatype'>mixed</code> <code class='argument'>x</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_write_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>write_cb</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Make an array of the argument, if it isn't already. A zero_type -  argument gives the empty array. This is useful when something is -  either an array or a basic datatype, for instance in headers from -  the MIME module or Protocols.HTTP.Server.</p> + <dd class='body--doc'><p>This function sets the <tt>write_callback</tt> for the file. The +  <tt>write_callback</tt> is called whenever there is buffer space +  available to write to for the file.</p> + <p> The callback is called with the <tt>id</tt> of the file as argument.</p>   </dd> - <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> - <dd></dd><dd class='body--doc'><p>Result depends of the argument type:</p> - <dl class='group--doc'><dt>arrayp(x)</dt> - <dd><p>arrayify(x) =&gt; x</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function does not set the file nonblocking.</p>   </dd> - <dt>zero_type(x)</dt> - <dd><p>arrayify(x) =&gt; ({})</p> - </dd> - <dt>otherwise</dt> - <dd><p>arrayify(x) =&gt; ({ x })</p> - </dd> - </dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>write()</code>, +  <code>query_write_callback()</code>, <code>set_read_callback()</code>, +  <code>set_close_callback()</code>, <code>set_read_oob_callback</code> +  <code>set_write_oob_callback()</code>, <code>set_id()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>common_prefix</b></span> + <span class='homogen--name'><b>set_write_oob_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>common_prefix</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>) <code class='argument'>arrs</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Find the longest common prefix from an array of arrays.</p> - </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>String.common_prefix</code></p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_write_oob_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>void</code>) <code class='argument'>write_oob_cb</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>count</b></span> + <span class='homogen--name'><b>tcgetattr</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>tcsetattr</b></span><br>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>count</span>(</b><code class='datatype'>array</code>|<code class='datatype'>mapping</code>|<code class='datatype'>multiset</code> <code class='argument'>haystack</code>, <code class='datatype'>mixed</code> <code class='argument'>needle</code><b>)</b></code><br> - <code><code class='datatype'>mapping</code>(<code class='datatype'>mixed</code>:<code class='datatype'>int</code>) <b><span class='method'>count</span>(</b><code class='datatype'>array</code>|<code class='datatype'>mapping</code>|<code class='datatype'>multiset</code> <code class='argument'>haystack</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>mapping</code> <b><span class='method'>tcgetattr</span>(</b><b>)</b></code><br> + <code><code class='datatype'>int</code> <b><span class='method'>tcsetattr</span>(</b><code class='datatype'>mapping</code> <code class='argument'>attr</code><b>)</b></code><br> + <code><code class='datatype'>int</code> <b><span class='method'>tcsetattr</span>(</b><code class='datatype'>mapping</code> <code class='argument'>attr</code>, <code class='datatype'>string</code> <code class='argument'>when</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the number of occurrences of <code>needle</code> in <code>haystack</code>. -  If the optional <code>needle</code> argument is omitted, <code>count</code> instead -  works similar to the unix command <tt>sort|uniq -c</tt>, returning -  a mapping with the number of occurrences of each element in -  <code>haystack</code>. For array or mapping <code>haystack</code>s, it's the values -  that are counted, for multisets the indices, as you'd expect.</p> + <dd class='body--doc'><p>Gets/sets term attributes. The returned value/the <code>attr</code> parameter +  is a mapping on the form</p> + <table class='box'><tr><td><code><code class='key'>"ispeed"</code> : <code class='datatype'>int(-1..)</code></code></td><td><p>In baud rate.</p> + </td></tr> + <tr><td><code><code class='key'>"ospeed"</code> : <code class='datatype'>int(-1..)</code></code></td><td><p>Out baud rate.</p> + </td></tr> + <tr><td><code><code class='key'>"csize"</code> : <code class='datatype'>int(-1..-1)</code>|<code class='datatype'>int(5..8)</code></code></td><td><p>Character size.</p> + </td></tr> + <tr><td><code><code class='key'>"rows"</code> : <code class='datatype'>int</code></code></td><td><p>Terminal rows.</p> + </td></tr> + <tr><td><code><code class='key'>"columns"</code> : <code class='datatype'>int</code></code></td><td><p>Terminal columns.</p> + </td></tr> + <tr><td><code><code class='key'>flag_name</code> : <code class='datatype'>bool</code></code></td><td><p>The value of a named flag. The flag name is +  the string describing the termios flags (IGNBRK, BRKINT, +  IGNPAR, PARMRK, INPCK, ISTRIP, INLCR, IGNCR, ICRNL, IUCLC, +  IXON, IXANY, IXOFF, IMAXBEL, OPOST, OLCUC, ONLCR, OCRNL, +  ONOCR, ONLRET, OFILL, OFDEL, OXTABS, ONOEOT, CSTOPB, CREAD, +  PARENB, PARODD, HUPCL, CLOCAL, CRTSCTS, ISIG, ICANON, XCASE, +  ECHO, ECHOE, ECHOK, ECHONL, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO, +  NOFLSH, TOSTOP, PENDIN). See the manpage for termios or +  other documentation for more information. All flags are not +  available on all platforms.</p> + </td></tr> + <tr><td><code><code class='key'>character_name</code> : <code class='datatype'>int(8bit)</code></code></td><td><p>Sets the value of a control character (VINTR, VQUIT, VERASE, +  VKILL, VEOF, VTIME, VMIN, VSWTC, VSTART, VSTOP, VSUSP, VEOL, +  VREPRINT, VDISCARD, VWERASE, VLNEXT, VEOL2). All control +  characters are not available on all platforms.</p> + </td></tr> + </table><p>Negative values are not allowed as indata, but might appear in the +  result from <code>tcgetattr</code> when the actual value is unknown. <code>tcsetattr</code> +  returns 0 if failed.</p> + <p> The argument <code>when</code> to <code>tcsetattr</code> describes when the +  changes are to take effect:</p> + <table class='box'><tr><td><code><code class='key'>"TCSANOW"</code></code></td><td><p>The change occurs immediately (default).</p> + </td></tr> + <tr><td><code><code class='key'>"TCSADRAIN"</code></code></td><td><p>The change occurs after all output has been written.</p> + </td></tr> + <tr><td><code><code class='key'>"TCSAFLUSH"</code></code></td><td><p>The change occurs after all output has been written, +  and empties input buffers.</p> + </td></tr> + </table>   </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>String.count</code>, <code>search</code>, <code>has_value</code></p> + <dt class='head--doc'>Example</dt> + <dd class='example'><pre><p>// setting the terminal in raw mode: +  Stdio.stdin-&gt;tcsetattr((["ECHO":0,"ICANON":0,"VMIN":0,"VTIME":0]));</p> + </pre></dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>Unknown flags are ignored by <code>tcsetattr()</code>. <code>tcsetattr</code> always +  changes the attribute, so only include attributes that actually +  should be altered in the attribute mapping.</p> + </dd> + <dt class='head--doc'>Bugs</dt> + <dd class='body--doc'><p>Terminal rows and columns setting by <code>tcsetattr()</code> is not +  currently supported.</p>   </dd></dl> -  + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.FILE</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Stdio.FILE is a buffered version of Stdio.File, it inherits Stdio.File and +  has most of the functionality of Stdio.File. However, it has an input buffer +  that allows line-by-line input. Note that the output part of Stdio.FILE is +  not buffered at this moment.</p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>dwim_sort_func</b></span> + <span class='homogen--name'><b>_get_iterator</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>dwim_sort_func</span>(</b><code class='datatype'>string</code> <code class='argument'>a</code>, <code class='datatype'>string</code> <code class='argument'>b</code><b>)</b></code></p></dd> + <dd><p><code><span class='class'>Stdio.FILE</span> <span class='method'>a</span>;<br> + foreach( a; index; value ) or<br></code><code><code class='modifier'>protected</code> <code class='datatype'>object</code> <b><span class='method'>_get_iterator</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Sort without respect to number formatting (most notably leading -  zeroes).</p> + <dd class='body--doc'><p>Returns an iterator that will loop over the lines in this file.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>line_iterator()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>flatten</b></span> + <span class='homogen--name'><b>getchar</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>flatten</span>(</b><code class='datatype'>array</code> <code class='argument'>a</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>getchar</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Flatten a multi-dimensional array to a one-dimensional array.</p> + <dd class='body--doc'><p>This function returns one character from the input stream.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns the ASCII value of the character.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>Returns an <tt>int</tt> and not a <tt>string</tt> of length 1.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>greedy_diff</b></span> + <span class='homogen--name'><b>gets</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>array</code>)) <b><span class='method'>greedy_diff</span>(</b><code class='datatype'>array</code> <code class='argument'>from</code>, <code class='datatype'>array</code> <code class='argument'>to</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>gets</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Like <code>Array.diff</code>, but tries to generate bigger continuous chunks of the -  differences, instead of maximizing the number of difference chunks. More -  specifically, <code>greedy_diff</code> optimizes the cases where <code>Array.diff</code> returns -  <code class='expr'>({&nbsp;...,&nbsp;A,&nbsp;Z,&nbsp;B,&nbsp;({}),&nbsp;C,&nbsp;...&nbsp;})</code> -  <code class='expr'>({&nbsp;...,&nbsp;A,&nbsp;X,&nbsp;B,&nbsp;&nbsp;Y+B,&nbsp;C,&nbsp;...&nbsp;})</code> -  into the somewhat shorter diff arrays -  <code class='expr'>({&nbsp;...,&nbsp;A,&nbsp;Z,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B+C,&nbsp;...&nbsp;})</code> -  <code class='expr'>({&nbsp;...,&nbsp;A,&nbsp;X+B+Y,&nbsp;B+C,&nbsp;...&nbsp;})</code></p> + <dd class='body--doc'><p>Read one line of input with support for input conversion.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>This function returns the line read if successful, and <tt>0</tt> if +  no more lines are available.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>ngets()</code>, <code>read()</code>, <code>line_iterator()</code>, <code>set_charset()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>lyskom_sort_func</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>file</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>lyskom_sort_func</span>(</b><code class='datatype'>string</code> <code class='argument'>a</code>, <code class='datatype'>string</code> <code class='argument'>b</code><b>)</b></code></p></dd> + <dd><p><code><span class='datatype'>inherit File</span> : <span class='inherit'>file</span></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Sort comparison function that does not care about case, nor about -  the contents of any parts of the string enclosed with '()'</p> - <p> Example: "Foo (bar)" is given the same weight as "foo (really!)"</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>oid_sort_func</b></span> + <span class='homogen--name'><b>line_iterator</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>oid_sort_func</span>(</b><code class='datatype'>string</code> <code class='argument'>a0</code>, <code class='datatype'>string</code> <code class='argument'>b0</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>object</code> <b><span class='method'>line_iterator</span>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>trim</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Sort with care of numerical sort for OID values: -  "1.2.1" before "1.11.1"</p> + <dd class='body--doc'><p>Returns an iterator that will loop over the lines in this file. +  If trim is true, all '\r' characters will be removed from the +  input.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>sort_array</code></p> + <dd class='body--doc'><p><code>_get_iterator()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>reduce</b></span> + <span class='homogen--name'><b>printf</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>reduce</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>fun</code>, <code class='datatype'>array</code> <code class='argument'>arr</code>, <code class='datatype'>mixed</code>|<code class='datatype'>void</code> <code class='argument'>zero</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>printf</span>(</b><code class='datatype'>string</code> <code class='argument'>format</code>, <code class='datatype'>mixed</code> ... <code class='argument'>data</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>reduce()</code> sends the first two elements in <code>arr</code> to <code>fun</code>, -  then the result and the next element in <code>arr</code> to <code>fun</code> and -  so on. Then it returns the result. The function will return -  <code>zero</code> if <code>arr</code> is the empty array. If <code>arr</code> has -  only one element, that element will be returned.</p> + <dd class='body--doc'><p>This function does approximately the same as: +  <code class='expr'><code>write</code>(<code>sprintf</code>(<code>format</code>,@<code>data</code>))</code>.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>rreduce()</code></p> + <dd class='body--doc'><p><code>write()</code>, <code>sprintf()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>rreduce</b></span> + <span class='homogen--name'><b>read</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>rreduce</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>fun</code>, <code class='datatype'>array</code> <code class='argument'>arr</code>, <code class='datatype'>mixed</code>|<code class='datatype'>void</code> <code class='argument'>zero</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>read</span>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>bytes</code>, <code class='datatype'>void</code>|<code class='datatype'>bool</code> <code class='argument'>now</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>rreduce()</code> sends the last two elements in <code>arr</code> to <code>fun</code>, -  then the third last element in <code>arr</code> and the result to <code>fun</code> and -  so on. Then it returns the result. The function will return -  <code>zero</code> if <code>arr</code> is the empty array. If <code>arr</code> has -  only one element, that element will be returned.</p> + <dd class='body--doc'><p>Read <code>bytes</code> with buffering and support for input conversion.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>reduce()</code></p> + <dd class='body--doc'><p><code>Stdio.File()-&gt;read()</code>, <code>set_charset()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>search_array</b></span> + <span class='homogen--name'><b>set_charset</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>search_array</span>(</b><code class='datatype'>array</code> <code class='argument'>arr</code>, <code class='datatype'>string</code>|<code class='datatype'>function</code>(:<code class='datatype void'>void</code>)|<code class='datatype'>int</code> <code class='argument'>fun</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_charset</span>(</b><code class='datatype'>string</code> <code class='argument'>charset</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>search_array()</code> works like <code>map()</code>, only it returns the index -  of the first call that returnes true instead.</p> - <p> If no call returns true, -1 is returned.</p> - </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>sum()</code>, <code>map()</code></p> + <dd class='body--doc'><p>Sets the input and output charset of this file to the specified +  charset.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>shuffle</b></span> + <span class='homogen--name'><b>ungets</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>shuffle</span>(</b><code class='datatype'>array</code> <code class='argument'>arr</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>ungets</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>shuffle()</code> gives back the same elements, but in random order. -  The array is modified destructively.</p> + <dd class='body--doc'><p>This function puts a string back in the input buffer. The string +  can then be read with eg <code>read()</code>, <code>gets()</code> or <code>getchar()</code>.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>permute()</code></p> + <dd class='body--doc'><p><code>read()</code>, <code>gets()</code>, <code>getchar()</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_array</b></span> + <span class='homogen--name'><b>write</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>sort_array</span>(</b><code class='datatype'>array</code> <code class='argument'>arr</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>)|<code class='datatype'>void</code> <code class='argument'>cmp</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>write</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>string</code> <code class='argument'>what</code>, <code class='datatype'>mixed</code> ... <code class='argument'>fmt</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This function sorts the array <code>arr</code> after a compare-function -  <code>cmp</code> which takes two arguments and should return <tt>1</tt> if the -  first argument is larger then the second. Returns the sorted array -  - <code>arr</code> is not sorted destructively.</p> - <p> The remaining arguments <code>args</code> will be sent as 3rd, 4th etc. argument -  to <code>cmp</code>.</p> - <p> If <code>cmp</code> is omitted, <code>`&gt;()</code> is used instead.</p> + <dd class='body--doc'><p>Write <code>what</code> with support for output_conversion.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>map()</code>, <code>sort()</code>, <code>`&gt;()</code>, <code>dwim_sort_func</code>, <code>lyskom_sort_func</code>, -  <code>oid_sort_func</code></p> + <dd class='body--doc'><p><code>Stdio.File()-&gt;write()</code></p>   </dd></dl> -  + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Port</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Handles listening to socket ports. Whenever you need a bound +  socket that is open and listens for connections you should +  use this program.</p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>sum</b></span> + <span class='homogen--name'><b>accept</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>sum</span>(</b><code class='datatype'>array</code> <code class='argument'>a</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>File</code> <b><span class='method'>accept</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Sum the elements of an array using `+</p> + <dd class='body--doc'><p>This function completes a connection made from a remote machine to +  this port. It returns a two-way stream in the form of a clone of +  Stdio.File. The new file is by default set to blocking mode.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>sum_arrays</b></span> + <span class='homogen--name'><b>bind</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>sum_arrays</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code> ... :<code class='datatype'>mixed</code>) <code class='argument'>sum</code>, <code class='datatype'>array</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>bind</span>(</b><code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>accept_callback</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>ip</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Applies the function <code>sum</code> columnwise on the elements in the -  provided arrays. E.g. <tt>sum_array(`+,a,b,c)</tt> does the same -  as <tt>`+(a[*],b[*],c[*])</tt>.</p> + <dd class='body--doc'><p>Bind opens a sockets and binds it to port number on the local machine. +  If the second argument is present, the socket is set to nonblocking +  and the callback funcition is called whenever something connects to +  the socket. The callback will receive the id for this port as argument. +  Bind returns 1 on success, and zero on failiure.</p> + <p> If the optional argument 'ip' is given, bind will try to bind to +  this ip name or number.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>accept</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>uniq2</b></span> + <span class='homogen--name'><b>create</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>uniq2</span>(</b><code class='datatype'>array</code> <code class='argument'>a</code><b>)</b></code></p></dd> + <dd><p><code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><b>)</b></code><br> + <code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><code class='datatype'>int</code> <code class='argument'>port</code><b>)</b></code><br> + <code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>accept_callback</code><b>)</b></code><br> + <code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>accept_callback</code>, <code class='datatype'>string</code> <code class='argument'>ip</code><b>)</b></code><br> + <code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><code class='argument'>"stdin"</code><b>)</b></code><br> + <code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><code class='argument'>"stdin"</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>accept_callback</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Perform the same action as the Unix uniq command on an array, -  that is, fold consecutive occurrences of the same element into -  a single element of the result array:</p> - <p> aabbbcaababb -&gt; abcabab.</p> - <p> See also the <code>uniq</code> function.</p> + <dd class='body--doc'><p>If the first argument is other than <tt>"stdin"</tt> the arguments will +  be passed to <code>bind()</code>.</p> + <p> When create is called with <tt>"stdin"</tt> as the first argument, a +  socket is created out of the file descriptor <tt>0</tt>. This is only +  useful if that actually is a socket to begin with.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>bind</code></p>   </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Function</b></h2> - </dt><dd> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>splice_call</b></span> + <span class='homogen--name'><b>errno</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>splice_call</span>(</b><code class='datatype'>array</code> <code class='argument'>args</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code>, <code class='datatype'>mixed</code>|<code class='datatype'>void</code> ... <code class='argument'>extra</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>errno</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Calls the given function with the <tt>args</tt> array plus the optional -  extra arguments as its arguments and returns the result.</p> - <p> Most useful in conjunction with <code>map</code>, and particularly in combination -  with <code>sscanf</code> with <tt>"...%{...%}..."</tt> scan strings (which indeed -  was what it was invented for in the first place).</p> - </dd> - <dt class='head--doc'><span id='p-args'></span>Parameter <code class='parameter'>args</code></dt> - <dd></dd><dd class='body--doc'><p>The first arguments the function <tt>f</tt> expects</p> - </dd> - <dt class='head--doc'><span id='p-f'></span>Parameter <code class='parameter'>f</code></dt> - <dd></dd><dd class='body--doc'><p>The function to apply the arguments on</p> - </dd> - <dt class='head--doc'><span id='p-extra'></span>Parameter <code class='parameter'>extra</code></dt> - <dd></dd><dd class='body--doc'><p>Optional extra arguments to send to <tt>f</tt></p> - </dd> - <dt class='head--doc'>Returns</dt> - <dd class='body--doc'><p>Whatever the supplied function <tt>f</tt> returns</p> - </dd> - <dt class='head--doc'>Example</dt> - <dd class='example'><pre><p><code class='expr'> - &nbsp;&nbsp;&nbsp;class&nbsp;Product(string&nbsp;name,&nbsp;string&nbsp;version) - &nbsp;&nbsp;&nbsp;{ - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;_sprintf() - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;sprintf("Product(%s/%s)",&nbsp;name,&nbsp;version); - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} - &nbsp;&nbsp;&nbsp;} - &nbsp;&nbsp;&nbsp;map(({&nbsp;({&nbsp;"pike",&nbsp;&nbsp;&nbsp;"7.1.11"&nbsp;}), - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;({&nbsp;"whitefish",&nbsp;"0.1"&nbsp;})&nbsp;}), - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function.splice_call,&nbsp;Product); - &nbsp;&nbsp;&nbsp;({&nbsp;/*&nbsp;2&nbsp;elements&nbsp;*/ -  &nbsp;Product(pike/7.1.11), -  &nbsp;Product(whitefish/0.1) - &nbsp;&nbsp;&nbsp;}) - &nbsp;&nbsp;&nbsp;</code></p> - </pre></dd></dl> - </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Program</b></h2> - </dt><dd> + <dd class='body--doc'><p>If the last call done on this port failed, errno will return an +  integer describing what went wrong. Refer to your unix manual for +  further information.</p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>all_inherits</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>_port</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>program</code>) <b><span class='method'>all_inherits</span>(</b><code class='datatype'>program</code> <code class='argument'>p</code><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function.</p> - </dd></dl> + <dd><p><code><span class='datatype'>inherit _port</span> : <span class='inherit'>_port</span></code></p></dd> + </dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>inherit_tree</b></span> + <span class='homogen--name'><b>listen_fd</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>inherit_tree</span>(</b><code class='datatype'>program</code> <code class='argument'>p</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>listen_fd</span>(</b><code class='datatype'>int</code> <code class='argument'>fd</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>accept_callback</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Recursively builds a inheritance tree by -  fetching programs inheritance lists.</p> + <dd class='body--doc'><p>This function does the same as port-&gt;bind, except that instead +  of creating a new socket and bind it to a port, it expects that +  the filedescriptor 'fd' is an already open port.</p>   </dd> - <dt class='head--doc'>Returns</dt> - <dd class='body--doc'><p>Returns an array with programs or arrays -  as elements.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function is only for the advanced user, and is generally used +  when sockets are passed to Pike at exec time.</p>   </dd> - <dt class='head--doc'>Example</dt> - <dd class='example'><pre><p>&gt; class a{} -  &gt; class b{} -  &gt; class c{ inherit a; } -  &gt; class d{ inherit b; inherit c; } -  &gt; Program.inherit_tree(d); -  Result: ({ /* 3 elements */ -  d, -  ({ /* 1 element */ -  program -  }), -  ({ /* 2 elements */ -  c, -  ({ /* 1 element */ -  program -  }) -  }) -  })</p> - </pre></dd></dl> - </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>ADT</b></h2> - </dt><dd><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Heap</b></h2> - </dt><dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>bind</code>, <code>accept</code></p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>adjust</b></span> + <span class='homogen--name'><b>port_accept</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>adjust</span>(</b><code class='datatype'>mixed</code> <code class='argument'>value</code><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function</p> - </dd></dl> + <dd><p><code><code class='object unresolved'>Stdio.File</code> <b><span class='method'>port_accept</span>(</b><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>push</b></span> + <span class='homogen--name'><b>query_address</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>push</span>(</b><code class='datatype'>mixed</code> <code class='argument'>value</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>query_address</span>(</b><code class='datatype'>string</code> <code class='argument'>arg1</code><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function</p> + <dd class='body--fixme'><p>Document this function.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>size</b></span> + <span class='homogen--name'><b>query_id</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>size</span>(</b><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function</p> + <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>query_id</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>This function returns the id for this port. The id is normally the +  first argument to accept_callback.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>set_id</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>top</b></span> + <span class='homogen--name'><b>set_id</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>top</span>(</b><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function</p> + <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>set_id</span>(</b><code class='datatype'>mixed</code> <code class='argument'>id</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>This function sets the id used for accept_callback by this port. +  The default id is <code>this_object()</code>.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>query_id</code></p>   </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.History</b></h2> + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.UDP</b></h2>   </dt><dd><dl class='group--doc'>   <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>A history is a stack where you can only push entries. When the stack has -  reached a certain size the oldest entries are removed on every push. -  Other proposed names for this data type is leaking stack and table -  (where you push objects onto the table in one end and objects are falling -  off the table in the other.</p> + <dd class='body--doc'><p>UDP (User Datagram Protocol) handling.</p>   </dd></dl>      <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_indices</b></span> + <dt class='head--type'><span class='homogen--type'>Constant</span> + <span class='homogen--name'><b>MSG_OOB</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>indices</span>(</b> <span class='class'>ADT.History</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the index numbers of the history entries -  available.</p> + <dd><p><code><code class='datatype'>constant</code> Stdio.UDP.<code class='constant'>MSG_OOB</code></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this constant.</p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_sizeof</b></span> + <dt class='head--type'><span class='homogen--type'>Constant</span> + <span class='homogen--name'><b>MSG_PEEK</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>sizeof</span>(</b> <span class='class'>ADT.History</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>A <code>sizeof</code> operation on this object returns the number -  of elements currently in the history, e.g. &lt;= the current -  max size.</p> + <dd><p><code><code class='datatype'>constant</code> Stdio.UDP.<code class='constant'>MSG_PEEK</code></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this constant.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_values</b></span> + <span class='homogen--name'><b>bind</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>values</span>(</b> <span class='class'>ADT.History</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>object</code> <b><span class='method'>bind</span>(</b><code class='datatype'>int</code> <code class='argument'>port</code><b>)</b></code><br> + <code><code class='datatype'>object</code> <b><span class='method'>bind</span>(</b><code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>string</code> <code class='argument'>address</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the values of the available history entries.</p> + <dd class='body--doc'><p>Binds a port for recieving or transmitting UDP.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`[]</b></span> + <span class='homogen--name'><b>connect</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> res = <code class='class'>ADT.History()</code>[&#32;<code class='class'>i</code>&#32;]</code></p></dd> + <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>connect</span>(</b><code class='datatype'>string</code> <code class='argument'>address</code>, <code class='datatype'>int</code> <code class='argument'>port</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Get a value from the history as if it was an array, e.g. -  both positive and negative numbers may be used. The positive -  numbers are however offset with 1, so [1] is the first entry -  in the history and [-1] is the last.</p> + <dd class='body--doc'><p>Establish an UDP connection.</p> + <p> This function connects an UDP socket previously created with +  <code>Stdio.UDP()</code> to a remote socket. The <code>address</code> is the IP name or +  number for the remote machine.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns <tt>1</tt> on success, <tt>0</tt> (zero) otherwise.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>If the socket is in nonblocking mode, you have to wait +  for a write or close callback before you know if the connection +  failed or not.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>bind()</code>, <code>query_address()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`[]=</b></span> + <span class='homogen--name'><b>enable_broadcast</b></span>   </dt> - <dd><p><code><code class='class'>ADT.History()</code>[&#32;<code class='class'>i</code>&#32;]&#32;=&#32;<code class='class'>value</code></code></p></dd> + <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>enable_broadcast</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Overwrite one value in the history. The history position may be -  identified either by positive or negative offset, like <code>`[]</code>.</p> + <dd class='body--doc'><p>Set the broadcast flag. +  If enabled then sockets receive packets sent to a broadcast +  address and they are allowed to send packets to a +  broadcast address.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns <tt>1</tt> on success, <tt>0</tt> (zero) otherwise.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This is normally only avalable to root users.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>errno</b></span>   </dt> - <dd><p><code><span class='object'>ADT.History</span> <span class='class'>ADT.History</span><b>(</b><code class='datatype'>int</code> <code class='argument'>max_size</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>errno</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>max_size</code> is the maximum number of entries that can reside in the -  history at the same time.</p> + <dd class='body--doc'><p>Returns the error code for the last command on this object. +  Error code is normally cleared when a command is successful.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>flush</b></span> + <span class='homogen--name'><b>get_type</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>flush</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>get_type</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Empties the history. All entries in the history are -  removed, to allow garbage collect to remove them. -  The entry sequence counter is not reset.</p> + <dd class='body--doc'><p>Returns socket type and protocol family.</p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_first_entry_num</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>UDP</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>get_first_entry_num</span>(</b><b>)</b></code></p></dd> + <dd><p><code><span class='datatype'>inherit files.UDP</span> : <span class='inherit'>UDP</span></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the absolute sequence number of the -  oldest result still in the history. Returns 0 -  if there are no results in the history.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_latest_entry_num</b></span> + <span class='homogen--name'><b>query_address</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>get_latest_entry_num</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>query_address</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the absolute sequence number of the latest -  result inserted into the history.</p> + <dd class='body--doc'><p>Returns the local address of a socket on the form "x.x.x.x port". +  If this file is not a socket, not connected or some other error occurs, +  zero is returned.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_maxsize</b></span> + <span class='homogen--name'><b>read</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>get_maxsize</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>|<code class='datatype'>string</code>) <b><span class='method'>read</span>(</b><b>)</b></code><br> + <code><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>|<code class='datatype'>string</code>) <b><span class='method'>read</span>(</b><code class='datatype'>int</code> <code class='argument'>flag</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the maximum number of values in the history</p> + <dd class='body--doc'><p>Read from the UDP socket.</p> + <p> Flag <code>flag</code> is a bitfield, 1 for out of band data and 2 for peek</p>   </dd> -  + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>mapping(string:int|string) in the form +  ([ +  "data" : string recieved data +  "ip" : string recieved from this ip +  "port" : int ...and this port +  ])</p> + </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>set_maxsize</code></p> + <dd class='body--doc'><p><code>set_read_callback()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>push</b></span> + <span class='homogen--name'><b>send</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>push</span>(</b><code class='datatype'>mixed</code> <code class='argument'>value</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>send</span>(</b><code class='datatype'>string</code> <code class='argument'>to</code>, <code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>string</code> <code class='argument'>message</code><b>)</b></code><br> + <code><code class='datatype'>int</code> <b><span class='method'>send</span>(</b><code class='datatype'>string</code> <code class='argument'>to</code>, <code class='datatype'>int</code> <code class='argument'>port</code>, <code class='datatype'>string</code> <code class='argument'>message</code>, <code class='datatype'>int</code> <code class='argument'>flags</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Push a new value into the history.</p> + <dd class='body--doc'><p>Send data to a UDP socket. The recepient address will be <code>to</code> +  and port will be <code>port</code>.</p> + <p> Flag <code>flag</code> is a bitfield, 1 for out of band data and +  2 for don't route flag.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>The number of bytes that were actually written.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>query_no_adjacent_duplicates</b></span> + <span class='homogen--name'><b>set_blocking</b></span>   </dt> - <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>query_no_adjacent_duplicates</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>object</code> <b><span class='method'>set_blocking</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Tells if the History object allows adjacent equal -  values. 1 means that only uniqe values are allowed -  adter each other.</p> - </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>set_no_adjacent_duplicates</code></p> + <dd class='body--doc'><p>Sets this object to be blocking.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>set_maxsize</b></span> + <span class='homogen--name'><b>set_nonblocking</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_maxsize</span>(</b><code class='datatype'>int</code> <code class='argument'>_maxsize</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>UDP</code> <b><span class='method'>set_nonblocking</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>UDP</code> <b><span class='method'>set_nonblocking</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>|<code class='datatype'>string</code>), <code class='datatype'>mixed</code> ... :<code class='datatype'>void</code>) <code class='argument'>read_cb</code>, <code class='datatype'>mixed</code> ... <code class='argument'>extra_args</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Set the maximume number of entries that can be -  stored in the history simultaneous.</p> + <dd class='body--doc'><p>Set this object to nonblocking mode.</p> + <p> If <code>read_cb</code> and <code>extra_args</code> are specified, they will be passed on +  to <code>set_read_callback()</code>.</p>   </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>get_maxsize</code></p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>The called object.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>set_no_adjacent_duplicates</b></span> + <span class='homogen--name'><b>set_read_callback</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_no_adjacent_duplicates</span>(</b><code class='datatype'>bool</code> <code class='argument'>i</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>UDP</code> <b><span class='method'>set_read_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>int</code>|<code class='datatype'>string</code>), <code class='datatype'>mixed</code> ... :<code class='datatype void'>void</code>) <code class='argument'>read_cb</code>, <code class='datatype'>mixed</code> ... <code class='argument'>extra_args</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Change how the History object should treat two -  identical values in a row. If 1 than only unique -  values are allowed after each other.</p> + <dd class='body--doc'><p>The <code>read_cb</code> function will receive a mapping similar to the mapping +  returned by <code>read()</code>:</p> + <table class='box'><tr><td><code><code class='key'>"data"</code> : <code class='datatype'>string</code></code></td><td><p>Received data.</p> + </td></tr> + <tr><td><code><code class='key'>"ip"</code> : <code class='datatype'>string</code></code></td><td><p>Data was sent from this IP.</p> + </td></tr> + <tr><td><code><code class='key'>"port"</code> : <code class='datatype'>int</code></code></td><td><p>Data was sent from this port.</p> + </td></tr> + </table>   </dd> -  + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>The called object.</p> + </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>query_no_adjacent_duplicates</code></p> + <dd class='body--doc'><p><code>read()</code></p>   </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Priority_queue</b></h2> - </dt><dd> +     - <hr /> - <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>adjust_pri</b></span> - </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>adjust_pri</span>(</b><code class='datatype'>mixed</code> <code class='argument'>handle</code>, <code class='datatype'>int</code> <code class='argument'>new_pri</code><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Inherit</span> - <span class='homogen--name'><b>Heap</b></span> - </dt> - <dd><p><code><span class='datatype'>inherit .Heap</span> : <span class='inherit'>Heap</span></code></p></dd> - </dl> -  -  - <hr /> - <dl class='group--doc'> +    <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>pop</b></span> + <span class='homogen--name'><b>set_type</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>pop</span>(</b><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function</p> - </dd></dl> + <dd><p><code><code class='datatype'>object</code> <b><span class='method'>set_type</span>(</b><code class='datatype'>int</code> <code class='argument'>sock_type</code><b>)</b></code><br> + <code><code class='datatype'>object</code> <b><span class='method'>set_type</span>(</b><code class='datatype'>int</code> <code class='argument'>sock_type</code>, <code class='datatype'>int</code> <code class='argument'>family</code><b>)</b></code></p></dd>    -  - <hr /> - <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>push</b></span> - </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>push</span>(</b><code class='datatype'>int</code> <code class='argument'>pri</code>, <code class='datatype'>mixed</code> <code class='argument'>val</code><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>Document this function</p> - </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Queue</b></h2> - </dt><dd><dl class='group--doc'> +    <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>A simple FIFO queue.</p> + <dd class='body--doc'><p>Sets socket type and protocol family.</p>   </dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>cast</b></span> + <span class='homogen--name'><b>wait</b></span>   </dt> - <dd><p><code><b>(</b><span class='datatype'>int</span><b>)</b><span class='class'>ADT.Queue</span>()<br><b>(</b><span class='datatype'>float</span><b>)</b><span class='class'>ADT.Queue</span>()<br><b>(</b><span class='datatype'>string</span><b>)</b><span class='class'>ADT.Queue</span>()<br><b>(</b><span class='datatype'>array</span><b>)</b><span class='class'>ADT.Queue</span>()<br><b>(</b><span class='datatype'>mapping</span><b>)</b><span class='class'>ADT.Queue</span>()<br><b>(</b><span class='datatype'>multiset</span><b>)</b><span class='class'>ADT.Queue</span>()</code></p></dd> + <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>wait</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>timeout</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>It is possible to cast ADT.Queue to an array.</p> + <dd class='body--doc'><p>Check for data and wait max. <code>timeout</code> seconds.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns <tt>1</tt> if data are ready, <tt>0</tt> (zero) otherwise.</p>   </dd></dl> -  + </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Stdio.Terminfo</b></h2> + </dt><dd>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>getFallbackTerm</b></span>   </dt> - <dd><p><code><span class='object'>ADT.Queue</span> <span class='class'>ADT.Queue</span><b>(</b><code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> + <dd><p><code><code class='modifier'>protected</code> <code class='object unresolved'>Termcap</code> <b><span class='method'>getFallbackTerm</span>(</b><code class='datatype'>string</code> <code class='argument'>term</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Creates a queue with the initial items <code>args</code> in it.</p> + <dd class='body--doc'><p>Returns an object describing the fallback terminal for the terminal +  <code>term</code>. This is usually equvivalent to <code>Stdio.Terminfo.getTerm("dumb")</code>.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p>Stdio.Terminfo.getTerm</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>flush</b></span> + <span class='homogen--name'><b>getTerm</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>flush</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>Termcap</code> <b><span class='method'>getTerm</span>(</b><code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>term</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Empties the queue.</p> + <dd class='body--doc'><p>Returns an object describing the terminal term. If term is not specified, it will +  default to <code>getenv("TERM")</code> or if that fails to "dumb".</p> + <p> Lookup of terminal information will first be done in the systems terminfo +  database, and if that fails in the termcap database. If neither database exists, a +  hardcoded entry for "dumb" will be used.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p>Stdio.Terminfo.getTerminfo, Stdio.Terminfo.getTermcap, Stdio.getFallbackTerm</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>read</b></span><br> - <span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get</b></span><br> + <span class='homogen--name'><b>getTermcap</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>read</span>(</b><b>)</b></code><br> - <code><code class='datatype'>mixed</code> <b><span class='method'>get</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>Termcap</code> <b><span class='method'>getTermcap</span>(</b><code class='datatype'>string</code> <code class='argument'>term</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the next element from the queue.</p> + <dd class='body--doc'><p>Returns the terminal description object for <code>term</code> from the +  systems termcap database. Returns 0 if not found.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p>Stdio.Terminfo.getTerm, Stdio.Terminfo.getTerminfo</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>is_empty</b></span> + <span class='homogen--name'><b>getTerminfo</b></span>   </dt> - <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>is_empty</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>Terminfo</code> <b><span class='method'>getTerminfo</span>(</b><code class='datatype'>string</code> <code class='argument'>term</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns true if the queue is empty, -  otherwise zero.</p> + <dd class='body--doc'><p>Returns the terminal description object for <code>term</code> from the +  systems terminfo database. Returns 0 if not found.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p>Stdio.Terminfo.getTerm, Stdio.Terminfo.getTermcap</p>   </dd></dl> -  + <dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Terminfo.Termcap</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Termcap terminal description object.</p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>peek</b></span> + <dt class='head--type'><span class='homogen--type'>Variable</span> + <span class='homogen--name'><b>aliases</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>peek</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>string</code>) Stdio.Terminfo.Termcap.<b><span class='variable'>aliases</span></b></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the next element from the queue -  without removing it from the queue.</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><br> - <span class='homogen--type'>Method</span> - <span class='homogen--name'><b>put</b></span><br> + <span class='homogen--name'><b>create</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>write</span>(</b><code class='datatype'>mixed</code> <code class='argument'>item</code><b>)</b></code><br> - <code><code class='datatype'>void</code> <b><span class='method'>put</span>(</b><code class='datatype'>mixed</code> <code class='argument'>item</code><b>)</b></code></p></dd> + <dd><p><code><span class='object'>Stdio.Terminfo.Termcap</span> <span class='class'>Stdio.Terminfo.Termcap</span><b>(</b><code class='datatype'>string</code> <code class='argument'>cap</code>, <code class='object unresolved'>TermcapDB</code>|<code class='datatype'>void</code> <code class='argument'>tcdb</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>maxrecurse</code><b>)</b></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Adds the <code>item</code> to the queue.</p> - </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Stack</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This class implements a simple stack. Instead of adding and removing -  elements to an array, and thus making it vary in size for every push -  and pop operation, this stack tries to keep the stack size constant. -  If however the stack risks to overflow, it will allocate double its -  current size, i.e. pushing an element on an full 32 slot stack will -  result in a 64 slot stack with 33 elements.</p> - </dd></dl> +       <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_sizeof</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>TermMachine</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>sizeof</span>(</b> <span class='class'>ADT.Stack</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> + <dd><p><code><span class='datatype'>inherit TermMachine</span> : <span class='inherit'>TermMachine</span></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>sizeof</code> on a stack returns the number of entries -  in the stack.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_values</b></span> + <span class='homogen--name'><b>tputs</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>values</span>(</b> <span class='class'>ADT.Stack</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>tputs</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>values</code> on a stack returns all the entries in -  the stack, in order.</p> + <dd class='body--doc'><p>Put termcap string</p>   </dd></dl> -  + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Terminfo.Terminfo</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Terminfo terminal description object</p> + </dd></dl>    -  +    <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`+</b></span> + <dt class='head--type'><span class='homogen--type'>Variable</span> + <span class='homogen--name'><b>aliases</b></span>   </dt> - <dd><p><code><code class='object unresolved'>this_program</code> res = <code class='class'>ADT.Stack()</code>&#32;+&#32;<code class='class'>s</code></code></p></dd> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>string</code>) Stdio.Terminfo.Terminfo.<b><span class='variable'>aliases</span></b></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>A stack added with another stack yields a third -  a third stack will all the stack elements from -  the two first stacks.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span>   <span class='homogen--name'><b>create</b></span>   </dt> - <dd><p><code><span class='object'>ADT.Stack</span> <span class='class'>ADT.Stack</span><b>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>initial_size</code><b>)</b></code></p></dd> + <dd><p><code><span class='object'>Stdio.Terminfo.Terminfo</span> <span class='class'>Stdio.Terminfo.Terminfo</span><b>(</b><code class='datatype'>string</code> <code class='argument'>filename</code><b>)</b></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>An initial stack size can be given when -  a stack is cloned. The default value is -  32.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>pop</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>TermMachine</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>pop</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>val</code><b>)</b></code></p></dd> + <dd><p><code><span class='datatype'>inherit TermMachine</span> : <span class='inherit'>TermMachine</span></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Pops and returns entry <code>val</code> from the stack, counting -  from the top. If no value is given the top element is -  popped and returned. All popped entries are freed from -  the stack.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>push</b></span> + <span class='homogen--name'><b>tputs</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>push</span>(</b><code class='datatype'>mixed</code> <code class='argument'>val</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Push an element on the top of the stack.</p> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>tputs</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl> -  + </dd></dl></dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Readline</b></h2> + </dt><dd>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>quick_pop</b></span> + <span class='homogen--name'><b>add_to_kill_ring</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>quick_pop</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>val</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Pops <code>val</code> entries from the stack, or one entry -  if no value is given. The popped entries are not -  actually freed, only the stack pointer is moved.</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_to_kill_ring</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>reset</b></span> + <span class='homogen--name'><b>create</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>reset</span>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>initial_size</code><b>)</b></code></p></dd> + <dd><p><code><span class='object'>Stdio.Readline</span> <span class='class'>Stdio.Readline</span><b>(</b><code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>infd</code>, <code class='datatype'>object</code>|<code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>interm</code>, <code class='datatype'>object</code>|<code class='datatype'>void</code> <code class='argument'>outfd</code>, <code class='datatype'>object</code>|<code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>outterm</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Empties the stack, resets the stack pointer -  and shrinks the stack size to the given value -  or 32 if none is given.</p> + <dd class='body--doc'><p>Creates a Readline object, that takes input from <code>infd</code> and has output +  on <code>outfd</code>.</p>   </dd> - <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>create</code></p> + <dt class='head--doc'><span id='p-infd'></span>Parameter <code class='parameter'>infd</code></dt> + <dd></dd><dd class='body--doc'><p>Defaults to <code>Stdio.stdout</code>.</p> + </dd> + <dt class='head--doc'><span id='p-interm'></span>Parameter <code class='parameter'>interm</code></dt> + <dd></dd><dd class='body--doc'><p>Defaults to <code>Stdio.Terminfo.getTerm()</code>.</p> + </dd> + <dt class='head--doc'><span id='p-outfd'></span>Parameter <code class='parameter'>outfd</code></dt> + <dd></dd><dd class='body--doc'><p>Defaults to <code>infd</code>, unless <code>infd</code> is 0, in which case +  <code>outfd</code> defaults to <code>Stdio.stdout</code>.</p> + </dd> + <dt class='head--doc'><span id='p-outterm'></span>Parameter <code class='parameter'>outterm</code></dt> + <dd></dd><dd class='body--doc'><p>Defaults to <code>interm</code>.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>set_stack</b></span> + <span class='homogen--name'><b>delete</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_stack</span>(</b><code class='datatype'>array</code> <code class='argument'>stack</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Sets the stacks content to the provided array.</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>delete</span>(</b><code class='datatype'>int</code> <code class='argument'>p1</code>, <code class='datatype'>int</code> <code class='argument'>p2</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>top</b></span> + <span class='homogen--name'><b>delta_history</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>top</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>delta_history</span>(</b><code class='datatype'>int</code> <code class='argument'>d</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the top element from the stack, without -  popping it.</p> + <dd class='body--doc'><p>Changes the line to a line from the history <code>d</code> steps from the +  current entry (0 being the current line, negative values older, +  and positive values newer).</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p>Throws an error if called on an empty stack.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>Only effective if you have a history object.</p>   </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Struct</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Implements a struct which can be used for serialization and -  deserialization of data.</p> - </dd> - <dt class='head--doc'>Example</dt> - <dd class='example'><pre><p>class ID3 { -  inherit ADT.Struct; -  Item head = Chars(3); -  Item title = Chars(30); -  Item artist = Chars(30); -  Item album = Chars(30); -  Item year = Chars(4); -  Item genre = Byte(); -  Item Comment = Chars(30); -  }</p> - <p> Stdio.File f = Stdio.File("foo.mp3"); -  f-&gt;seek(-128); -  ADT.Struct tag = ID3(f); -  if(tag-&gt;head=="TAG") { -  write("Title: %s\n", tag-&gt;title); -  tag-&gt;title = "A new title" + "\0"*19; -  f-&gt;seek(-128); -  f-&gt;write( (string)tag ); -  }</p> - </pre></dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_indices</b></span> + <span class='homogen--name'><b>destroy</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>string</code>) <b><span class='method'>indices</span>(</b> <span class='class'>ADT.Struct</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The indices of a struct is the name of the struct items.</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>destroy</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_sizeof</b></span> + <span class='homogen--name'><b>edit</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>sizeof</span>(</b> <span class='class'>ADT.Struct</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The size of the struct object is the number of bytes -  allocated for the struct.</p> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>edit</span>(</b><code class='datatype'>string</code> <code class='argument'>data</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>local_prompt</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>void</code> <code class='argument'>attrs</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_values</b></span> + <span class='homogen--name'><b>enable_history</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>values</span>(</b> <span class='class'>ADT.Struct</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The values of a struct is the values of the struct items.</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>enable_history</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='object unresolved'>History</code>|<code class='datatype'>int</code> <code class='argument'>hist</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`[]</b></span><br> - <span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`-&gt;</b></span><br> + <span class='homogen--name'><b>eof</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> res = <code class='class'>ADT.Struct()</code>[&#32;<code class='class'>item</code>&#32;]</code><br> - <code><code class='datatype'>mixed</code> res = <code class='class'>ADT.Struct()</code>-&gt;X</code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The struct can be indexed by item name to get the -  associated value.</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>eof</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`[]=</b></span><br> - <span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`-&gt;=</b></span><br> + <span class='homogen--name'><b>get_history</b></span>   </dt> - <dd><p><code><code class='class'>ADT.Struct()</code>[&#32;<code class='class'>item</code>&#32;]&#32;=&#32;y</code><br> - <code><code class='class'>ADT.Struct()</code>-&gt;X&#32;=&#32;y</code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>It is possible to assign a new value to a struct -  item by indexing it by name and assign a value.</p> + <dd><p><code><code class='object unresolved'>History</code> <b><span class='method'>get_history</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>cast</b></span> + <span class='homogen--name'><b>get_input_controller</b></span>   </dt> - <dd><p><code><b>(</b><span class='datatype'>int</span><b>)</b><span class='class'>ADT.Struct</span>()<br><b>(</b><span class='datatype'>float</span><b>)</b><span class='class'>ADT.Struct</span>()<br><b>(</b><span class='datatype'>string</span><b>)</b><span class='class'>ADT.Struct</span>()<br><b>(</b><span class='datatype'>array</span><b>)</b><span class='class'>ADT.Struct</span>()<br><b>(</b><span class='datatype'>mapping</span><b>)</b><span class='class'>ADT.Struct</span>()<br><b>(</b><span class='datatype'>multiset</span><b>)</b><span class='class'>ADT.Struct</span>()</code></p></dd> + <dd><p><code><code class='object unresolved'>InputController</code> <b><span class='method'>get_input_controller</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The struct can be casted into a string, which is eqivivalent -  to running <code>encode</code>, or into an array. When casted into an -  array each array element is the encoded value of that struct -  item.</p> + <dd class='body--doc'><p>get current input control object</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Terminal input controller object</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>get_output_controller</b></span>   </dt> - <dd><p><code><span class='object'>ADT.Struct</span> <span class='class'>ADT.Struct</span><b>(</b><code class='datatype'>void</code>|<code class='datatype'>string</code>|<code class='object unresolved'>Stdio.File</code> <code class='argument'>data</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>OutputController</code> <b><span class='method'>get_output_controller</span>(</b><b>)</b></code></p></dd>    - <dt class='head--doc'><span id='p-data'></span>Parameter <code class='parameter'>data</code></dt> - <dd></dd><dd class='body--doc'><p>Data to be decoded and populate the struct. Can -  either be a file object or a string.</p> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>get current output control object</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Terminal output controller object</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>decode</b></span> + <span class='homogen--name'><b>get_prompt</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>decode</span>(</b><code class='datatype'>string</code>|<code class='object unresolved'>Stdio.File</code> <code class='argument'>data</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>get_prompt</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Decodes <code>data</code> according to the struct and populates -  the struct variables. The <code>data</code> can either be a file -  object or a string.</p> + <dd class='body--doc'><p>Return the current prompt string.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>encode</b></span> + <span class='homogen--name'><b>getcursorpos</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>encode</span>(</b><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Serializes the struct into a string. This string is equal -  to the string fed to <code>decode</code> if nothing in the struct -  has been altered.</p> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>getcursorpos</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl> - <dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Struct.Byte</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>One byte, integer value between 0 and 255.</p> - </dd></dl> +     - <hr /> - <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> - </dt> - <dd><p><code><span class='object'>ADT.Struct.Byte</span> <span class='class'>ADT.Struct.Byte</span><b>(</b><code class='datatype'>void</code>|<code class='datatype'>int(8bit)</code> <code class='argument'>initial_value</code><b>)</b></code></p></dd> +     - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The byte can be initialized with an optional value.</p> - </dd></dl> -  -  +    <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Inherit</span> - <span class='homogen--name'><b>Item</b></span> - </dt> - <dd><p><code><span class='datatype'>inherit Item</span> : <span class='inherit'>Item</span></code></p></dd> - </dl> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Struct.Chars</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>A string of bytes.</p> - </dd></dl> -  - <hr /> - <dl class='group--doc'> +    <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>getmark</b></span>   </dt> - <dd><p><code><span class='object'>ADT.Struct.Chars</span> <span class='class'>ADT.Struct.Chars</span><b>(</b><code class='datatype'>int</code> <code class='argument'>size</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>value</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The number of bytes that are part of this struct item. -  The initial value of the char string is <code>value</code> or, -  if not provided, a string of zero bytes.</p> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>getmark</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Inherit</span> - <span class='homogen--name'><b>Item</b></span> - </dt> - <dd><p><code><span class='datatype'>inherit Item</span> : <span class='inherit'>Item</span></code></p></dd> - </dl> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Struct.Item</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Interface class for struct items.</p> - </dd></dl></dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Struct.Word</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>One word in network order, integer value between 0 and 65535.</p> - </dd></dl> -  - <hr /> - <dl class='group--doc'> +    <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>gettext</b></span>   </dt> - <dd><p><code><span class='object'>ADT.Struct.Word</span> <span class='class'>ADT.Struct.Word</span><b>(</b><code class='datatype'>void</code>|<code class='datatype'>int(16bit)</code> <code class='argument'>initial_value</code><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The byte can be initialized with an optional value.</p> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>gettext</span>(</b><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Inherit</span> - <span class='homogen--name'><b>Item</b></span> - </dt> - <dd><p><code><span class='datatype'>inherit Item</span> : <span class='inherit'>Item</span></code></p></dd> - </dl> - </dd></dl></dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.struct</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>generic data structure</p> - </dd></dl> -  - <hr /> - <dl class='group--doc'> +    <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>add_data</b></span> + <span class='homogen--name'><b>history</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_data</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>Add data to struct</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>data to add to end of struct</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>history</span>(</b><code class='datatype'>int</code> <code class='argument'>n</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>contents</b></span> + <span class='homogen--name'><b>insert</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>contents</span>(</b><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Return data, without removing it</p> - </dd> - <dt class='head--doc'>Returns</dt> - <dd class='body--doc'><p>contents of struct</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>insert</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>p</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>kill</b></span>   </dt> - <dd><p><code><span class='object'>ADT.struct</span> <span class='class'>ADT.struct</span><b>(</b><code class='datatype'>void</code>|<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>create a new struct</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>initial data in struct</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>kill</span>(</b><code class='datatype'>int</code> <code class='argument'>p1</code>, <code class='datatype'>int</code> <code class='argument'>p2</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_fix_string</b></span> + <span class='homogen--name'><b>kill_ring_yank</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>get_fix_string</span>(</b><code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>kill_ring_yank</span>(</b><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_fix_uint_array</b></span> + <span class='homogen--name'><b>list_completions</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>mixed</code>) <b><span class='method'>get_fix_uint_array</span>(</b><code class='datatype'>int</code> <code class='argument'>item_size</code>, <code class='datatype'>int</code> <code class='argument'>size</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>list_completions</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>c</code><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_rest</b></span> + <span class='homogen--name'><b>message</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>get_rest</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>message</span>(</b><code class='datatype'>string</code> <code class='argument'>msg</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>get remainder of data from struct, clearing the struct</p> - </dd> - <dt class='head--doc'>Returns</dt> - <dd class='body--doc'><p>Remaining contents of struct</p> + <dd class='body--doc'><p>Print a message to the output device</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_uint</b></span> + <span class='homogen--name'><b>newline</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>get_uint</span>(</b><code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>newline</span>(</b><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_var_string</b></span> + <span class='homogen--name'><b>pointmark</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>get_var_string</span>(</b><code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>pointmark</span>(</b><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>get_var_uint_array</b></span> + <span class='homogen--name'><b>read</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>mixed</code>) <b><span class='method'>get_var_uint_array</span>(</b><code class='datatype'>int</code> <code class='argument'>item_size</code>, <code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>read</span>(</b><code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>prompt</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>void</code> <code class='argument'>attrs</code><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>is_empty</b></span> + <span class='homogen--name'><b>redisplay</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>is_empty</span>(</b><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>is struct empty?</p> - </dd> - <dt class='head--doc'>Returns</dt> - <dd class='body--doc'><p>1 if empty, 0 otherwise</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>redisplay</span>(</b><code class='datatype'>int</code> <code class='argument'>clear</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>nobackup</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>pop_data</b></span> + <span class='homogen--name'><b>region</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>pop_data</span>(</b><b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Return all data in struct, emptying the struct</p> - </dd> - <dt class='head--doc'>Returns</dt> - <dd class='body--doc'><p>contents of struct</p> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>region</span>(</b><code class='datatype'>int</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>put_bignum</b></span> + <span class='homogen--name'><b>set_blocking</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>put_bignum</span>(</b><code class='datatype'>object</code> <code class='argument'>i</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_blocking</span>(</b><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>put_fix_string</b></span> + <span class='homogen--name'><b>set_echo</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>put_fix_string</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code></p></dd> - <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_echo</span>(</b><code class='datatype'>int</code> <code class='argument'>onoff</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Set text echo on or off.</p> + </dd> + <dt class='head--doc'><span id='p-onoff'></span>Parameter <code class='parameter'>onoff</code></dt> + <dd></dd><dd class='body--doc'><p>1 for echo, 0 for no echo.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>put_fix_uint_array</b></span> + <span class='homogen--name'><b>set_nonblocking</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>put_fix_uint_array</span>(</b><code class='datatype'>array</code>(<code class='datatype'>int</code>) <code class='argument'>data</code>, <code class='datatype'>int</code> <code class='argument'>item_size</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_nonblocking</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>put_uint</b></span> + <span class='homogen--name'><b>set_prompt</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>put_uint</span>(</b><code class='datatype'>int</code> <code class='argument'>i</code>, <code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>set_prompt</span>(</b><code class='datatype'>string</code> <code class='argument'>newp</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>void</code> <code class='argument'>newattrs</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Append an unsigned integer to struct</p> + <dd class='body--doc'><p>Set the prompt string.</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>unsigned integer to append</p> + <dt class='head--doc'><span id='p-newp'></span>Parameter <code class='parameter'>newp</code></dt> + <dd></dd><dd class='body--doc'><p>New prompt string</p>   </dd> - <dt class='head--doc'><span id='p-len'></span>Parameter <code class='parameter'>len</code></dt> - <dd></dd><dd class='body--doc'><p>length of integer in bytes</p> + <dt class='head--doc'><span id='p-newattrs'></span>Parameter <code class='parameter'>newattrs</code></dt> + <dd></dd><dd class='body--doc'><p>Terminal attributes</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>put_var_string</b></span> + <span class='homogen--name'><b>setcursorpos</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>put_var_string</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>setcursorpos</span>(</b><code class='datatype'>int</code> <code class='argument'>p</code><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>put_var_uint_array</b></span> + <span class='homogen--name'><b>setmark</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>put_var_uint_array</span>(</b><code class='datatype'>array</code>(<code class='datatype'>int</code>) <code class='argument'>data</code>, <code class='datatype'>int</code> <code class='argument'>item_size</code>, <code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>setmark</span>(</b><code class='datatype'>int</code> <code class='argument'>p</code><b>)</b></code></p></dd>   <dt class='head--fixme'>FIXME</dt> - <dd class='body--fixme'><p>document me!</p> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>ADT.Relation</b></h2> - </dt><dd><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Relation.Binary</b></h2> - </dt><dd> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_sizeof</b></span> + <span class='homogen--name'><b>write</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>sizeof</span>(</b> <span class='class'>ADT.Relation.Binary</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Returns the number of relation entries in the relation. (Or with -  other words: the number of relations in the relation set.)</p> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>write</span>(</b><code class='datatype'>string</code> <code class='argument'>msg</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>word_wrap</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function</p>   </dd></dl> -  + </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Stdio</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>An instance of FILE("stdin"), the standard input stream. Use this +  when you want to read anything from the standard input. +  This example will read lines from standard input for as long as there +  are more lines to read. Each line will then be written to stdout together +  with the line number. We could use <code>Stdio.stdout.write</code> instead +  of just <code>write</code>, since they are the same function.</p> + </dd> + <dt class='head--doc'>Example</dt> + <dd class='example'><pre><p>int main() +  { +  int line; +  while(string s=Stdio.stdin.gets()) +  write(sprintf("%5d: %s\n",line++,s)); +  }</p> + </pre></dd></dl>    -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`&amp;</b></span> + <span class='homogen--name'><b>append_file</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> res = <code class='class'>ADT.Relation.Binary()</code>&#32;&amp;&#32;<code class='class'>rel</code></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>append_file</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>str</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>access</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The expression `rel1 &amp; rel2' returns a new relation which has -  those and only those relation entries that are present in both -  rel1 and rel2.</p> + <dd class='body--doc'><p>Append the string <code>str</code> onto the file <code>filename</code>.</p> + <p> For a description of <code>access</code>, see <code>Stdio.File-&gt;open()</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p>Throws an error if <code>filename</code> couldn't be opened for writing.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns the number of bytes written.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>write_file()</code>, <code>read_bytes()</code>, <code>Stdio.File()-&gt;open()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`()</b></span> + <span class='homogen--name'><b>append_path</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> res = <code class='class'>ADT.Relation.Binary()</code>()</code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>append_path</span>(</b><code class='datatype'>string</code> <code class='argument'>absolute</code>, <code class='datatype'>string</code> ... <code class='argument'>relative</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Does the same as the <code>contains</code> function: returns true if the -  relation "<code>left</code> R <code>right</code>" exists, and otherwise false.</p> + <dd class='body--doc'><p>Append <code>relative</code> paths to an <code>absolute</code> path and remove any +  <tt>"//"</tt>, <tt>"../"</tt> or <tt>"/."</tt> to produce a straightforward +  absolute path as a result.</p> + <p> <tt>"../"</tt> is ignorded in the relative paths if it makes the +  created path begin with something else than the absolute path +  (or so far created path).</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>Warning: This does not work on NT. +  (Consider paths like: k:/fnord)</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>combine_path()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'>Syntax</dt> - <dd><p><code><code class='datatype'>mixed</code> res = <code class='class'>ADT.Relation.Binary()</code>&#32;|&#32;<code class='class'>rel</code></code><code><code class='datatype'>mixed</code> ADT.Relation.Binary.<b><span class='variable'>`+</span></b></code></p></dd> -  - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The expression `rel1 | rel2' and `rel1 + rel2' returns a new -  relation which has all the relation entries present in rel1, -  or rel2, or both.</p> - </dd></dl> -  -  - <hr /> - <dl class='group--doc'> +    <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`-</b></span> + <span class='homogen--name'><b>async_cp</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> res = <code class='class'>ADT.Relation.Binary()</code>&#32;-&#32;<code class='class'>rel</code></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>async_cp</span>(</b><code class='datatype'>string</code> <code class='argument'>from</code>, <code class='datatype'>string</code> <code class='argument'>to</code>, <code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>mixed</code> ... :<code class='datatype'>void</code>) <code class='argument'>callback</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The expression `rel1 - rel2' returns a new relation which has -  those and only those relation entries that are present in rel1 -  and not present in rel2.</p> + <dd class='body--doc'><p>Copy a file asynchronously.</p> + <p> This function is similar to <code>cp()</code>, but works asynchronously.</p> + </dd> + <dt class='head--doc'><span id='p-from'></span>Parameter <code class='parameter'>from</code></dt> + <dd></dd><dd class='body--doc'><p>Name of file to copy.</p> + </dd> + <dt class='head--doc'><span id='p-to'></span>Parameter <code class='parameter'>to</code></dt> + <dd></dd><dd class='body--doc'><p>Name of file to create or replace with a copy of <code>from</code>.</p> + </dd> + <dt class='head--doc'><span id='p-cb'></span>Parameter <code class='parameter'>cb</code></dt> + <dd></dd><dd class='body--doc'><p>Function to be called on completion. +  The first argument will be <tt>1</tt> on success, and <tt>0</tt> (zero) +  otherwise. The rest of the arguments tp <code>callback</code> are passed +  verbatim from <code>args</code>.</p> + </dd> + <dt class='head--doc'><span id='p-args'></span>Parameter <code class='parameter'>args</code></dt> + <dd></dd><dd class='body--doc'><p>Extra arguments to pass to <code>callback</code>.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>For <code>callback</code> to be called, the backend must be active (ie +  <code>main()</code> must have returned <tt>-1</tt>).</p> + </dd> + <dt class='head--doc'>Bugs</dt> + <dd class='body--doc'><p>Currently the file sizes are not compared, so the destination file +  (<code>to</code>) may be truncated.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>cp()</code>, <code>sendfile()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>add</b></span> + <span class='homogen--name'><b>exist</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>add</span>(</b><code class='datatype'>mixed</code> <code class='argument'>left</code>, <code class='datatype'>mixed</code> <code class='argument'>right</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>exist</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Adds "<code>left</code> R <code>right</code>" as a member of the relation. Returns -  the same relation.</p> + <dd class='body--doc'><p>Check if a <code>path</code> exists.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns true if the given path exists (is a directory or file), +  otherwise false.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>is_dir()</code>, <code>is_file()</code>, <code>is_link()</code>, <code>file_stat()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>contains</b></span> + <span class='homogen--name'><b>file_equal</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>contains</span>(</b><code class='datatype'>mixed</code> <code class='argument'>left</code>, <code class='datatype'>mixed</code> <code class='argument'>right</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>file_equal</span>(</b><code class='datatype'>string</code> <code class='argument'>file_1</code>, <code class='datatype'>string</code> <code class='argument'>file_2</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Return true/false: does the relation "<code>left</code> R <code>right</code>" exist?</p> + <dd class='body--doc'><p>Returns nonzero if the given paths are files with identical +  content, returns zero otherwise. Zero is also returned for any +  sort of I/O error.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>filter</b></span> + <span class='homogen--name'><b>file_size</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>filter</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>file_size</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Filters the entries in the relation, and returns a relation with -  all those entries for which the filtering function <code>f</code> returned -  true. The function <code>f</code> gets two arguments: the left and the right -  value for every entry in the relation.</p> + <dd class='body--doc'><p>Give the size of a file. Size -1 indicates that the file either +  does not exist, or that it is not readable by you. Size -2 +  indicates that it is a directory.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>file_stat()</code>, <code>write_file()</code>, <code>read_bytes()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>filter_destructively</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>files</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>filter_destructively</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code><b>)</b></code></p></dd> + <dd><p><code><span class='datatype'>inherit files</span> : <span class='inherit'>files</span></code></p></dd> + </dl>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Filters the entries in the relation destructively, removing all -  entries for which the filtering function <code>f</code> returns false. -  The function <code>f</code> gets two arguments: the left and the right value -  for each entry in the relation.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>find_shortest_path</b></span> + <span class='homogen--name'><b>is_dir</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>find_shortest_path</span>(</b><code class='datatype'>mixed</code> <code class='argument'>from</code>, <code class='datatype'>mixed</code> <code class='argument'>to</code>, <code class='datatype'>void</code>|<code class='datatype'>multiset</code> <code class='argument'>avoiding</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>is_dir</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Assuming the relation's domain and range sets are equal, and that -  the relation xRy means "there is a path from node x to node y", -  <code>find_shortest_path</code> attempts to find a path with a minimum number -  of steps from one given node to another. The path is returned as an -  array of nodes (including the starting and ending node), or 0 if no -  path was found. If several equally short paths exist, one of them -  will be chosen pseudorandomly.</p> - <p> Trying to find a path from a node to itself will always succeed, -  returning an array of one element: the node itself. (Or in other -  words, a path with no steps, only a starting/ending point).</p> - <p> The argument <code>avoiding</code> is either 0 (or omitted), or a multiset of -  nodes that must not be part of the path.</p> + <dd class='body--doc'><p>Check if a <code>path</code> is a directory.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns true if the given path is a directory, otherwise false.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>exist()</code>, <code>is_file()</code>, <code>is_link()</code>, <code>file_stat()</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_id</b></span> + <span class='homogen--name'><b>is_file</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>get_id</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>is_file</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Return the ID value which was given as first argument to create().</p> + <dd class='body--doc'><p>Check if a <code>path</code> is a file.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns true if the given path is a file, otherwise false.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>exist()</code>, <code>is_dir()</code>, <code>is_link()</code>, <code>file_stat()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>make_symmetric</b></span> + <span class='homogen--name'><b>is_link</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>make_symmetric</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>is_link</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Makes the relation symmetric, i.e. makes sure that if xRy is part -  of the relation set, then yRx should also be a part of the relation -  set.</p> + <dd class='body--doc'><p>Check if a <code>path</code> is a symbolic link.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns true if the given path is a symbolic link, otherwise false.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>exist()</code>, <code>is_dir()</code>, <code>is_file()</code>, <code>file_stat()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>map</b></span> + <span class='homogen--name'><b>mkdirhier</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>map</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>mkdirhier</span>(</b><code class='datatype'>string</code> <code class='argument'>pathname</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Maps every entry in the relation. The function f gets two -  arguments: the left and the right relation value. Returns -  an array with the return values of f for each and every -  mapped entry.</p> - <p> Note: since the entries in the relation are not ordered, -  the returned array will have its elements in no particular -  order. If you need to know which relation entry produced which -  result in the array, you have to make that information part -  of the value that <code>f</code> returns.</p> + <dd class='body--doc'><p>Creates zero or more directories to ensure that the given <code>pathname</code> is +  a directory.</p> + <p> If a <code>mode</code> is given, it's used for the new directories after being &amp;'ed +  with the current umask (on OS'es that support this).</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns zero if it fails and nonzero if it is successful.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>mkdir()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>remove</b></span> + <span class='homogen--name'><b>perror</b></span>   </dt> - <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>remove</span>(</b><code class='datatype'>mixed</code> <code class='argument'>left</code>, <code class='datatype'>mixed</code> <code class='argument'>right</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>perror</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>Removes "<code>left</code> R <code>right</code>" as a member of the relation. Returns -  the same relation.</p> + <dd class='body--doc'><p>This function prints a message to stderr along with a description +  of what went wrong if available. It uses the system errno to find +  out what went wrong, so it is only applicable to IO errors.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>werror()</code></p>   </dd></dl> - <dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Relation.Binary._get_iterator</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>An iterator which makes all the left/right entities in the relation -  available as index/value pairs.</p> - </dd></dl></dd></dl></dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>ADT.Table</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>ADT.Table is a generic module for manipulating tables.</p> - <p> Each table contains one or several columns. -  Each column is associated with a name, the column name. -  Optionally, one can provide a column type. The Table module can do a number -  of operations on a given table, like computing the sum of a column, -  grouping, sorting etc.</p> - <p> All column references are case insensitive. A column can be referred to by -  its position (starting from zero). All operations are non-destructive. That -  means that a new table object will be returned after, for example, a sort.</p> - </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Table.table</b></h2> - </dt><dd><dl class='group--doc'> - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The table base-class.</p> - </dd></dl> +     -  +    <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_indices</b></span> + <span class='homogen--name'><b>read_bytes</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>string</code>) <b><span class='method'>indices</span>(</b> <span class='class'>ADT.Table.table</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>read_bytes</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>int</code> <code class='argument'>start</code>, <code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code><br> + <code><code class='datatype'>string</code> <b><span class='method'>read_bytes</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>int</code> <code class='argument'>start</code><b>)</b></code><br> + <code><code class='datatype'>string</code> <b><span class='method'>read_bytes</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns the column names for the table. The case used when -  the table was created will be returned.</p> + <dd class='body--doc'><p>Read <code>len</code> number of bytes from the file <code>filename</code> starting at byte +  <code>start</code>, and return it as a string.</p> + <p> If <code>len</code> is omitted, the rest of the file will be returned.</p> + <p> If <code>start</code> is also omitted, the entire file will be returned.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p>Throws an error if <code>filename</code> isn't a regular file.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns <tt>0</tt> (zero) on failure to open <code>filename</code>.</p> + <p> Returns a string with the requested data otherwise.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>read_file</code>, <code>write_file()</code>, <code>append_file()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_sizeof</b></span> + <span class='homogen--name'><b>read_file</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> <b><span class='method'>sizeof</span>(</b> <span class='class'>ADT.Table.table</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>read_file</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code><b>)</b></code><br> + <code><code class='datatype'>string</code> <b><span class='method'>read_file</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>int</code> <code class='argument'>start</code>, <code class='datatype'>int</code> <code class='argument'>len</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns the number of rows in the table.</p> + <dd class='body--doc'><p>Read <code>len</code> lines from a file <code>filename</code> after skipping <code>start</code> lines +  and return those lines as a string. If both <code>start</code> and <code>len</code> are omitted +  the whole file is read.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>read_bytes()</code>, <code>write_file()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>_values</b></span> + <span class='homogen--name'><b>recursive_rm</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>array</code>) <b><span class='method'>values</span>(</b> <span class='class'>ADT.Table.table</span> <span class='argument'>arg</span> <b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>recursive_rm</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns the contents of a table as a two dimensional array. -  The format is an array of rows. Each row is an array of columns.</p> + <dd class='body--doc'><p>Remove a file or directory a directory tree.</p> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns 0 on failure, nonzero otherwise.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>rm</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`==</b></span> + <span class='homogen--name'><b>sendfile</b></span>   </dt> - <dd><p><code><code class='datatype'>int</code> res = <code class='class'>ADT.Table.table()</code>&#32;==&#32;<code class='class'>table</code></code></p></dd> + <dd><p><code><code class='datatype'>object</code> <b><span class='method'>sendfile</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>headers</code>, <code class='object unresolved'>File</code> <code class='argument'>from</code>, <code class='datatype'>int</code> <code class='argument'>offset</code>, <code class='datatype'>int</code> <code class='argument'>len</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>trailers</code>, <code class='object unresolved'>File</code> <code class='argument'>to</code><b>)</b></code><br> + <code><code class='datatype'>object</code> <b><span class='method'>sendfile</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>headers</code>, <code class='object unresolved'>File</code> <code class='argument'>from</code>, <code class='datatype'>int</code> <code class='argument'>offset</code>, <code class='datatype'>int</code> <code class='argument'>len</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>trailers</code>, <code class='object unresolved'>File</code> <code class='argument'>to</code>, <code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>mixed</code> ... :<code class='datatype'>void</code>) <code class='argument'>callback</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method compares two tables. They are equal if the contents -  of the tables and the column names are equal. The column name -  comparison is case insensitive.</p> + <dd class='body--doc'><p>Sends <code>headers</code> followed by <code>len</code> bytes starting at <code>offset</code> +  from the file <code>from</code> followed by <code>trailers</code> to the file <code>to</code>. +  When completed <code>callback</code> will be called with the total number of +  bytes sent as the first argument, followed by <code>args</code>.</p> + <p> Any of <code>headers</code>, <code>from</code> and <code>trailers</code> may be left out +  by setting them to <tt>0</tt>.</p> + <p> Setting <code>offset</code> to <tt>-1</tt> means send from the current position in +  <code>from</code>.</p> + <p> Setting <code>len</code> to <tt>-1</tt> means send until <code>from</code>'s end of file is +  reached.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>The sending is performed asynchronously, and may complete +  before the function returns.</p> + <p> For <code>callback</code> to be called, the backend must be active (ie +  <code>main()</code> must have returned <tt>-1</tt>).</p> + <p> In some cases, the backend must also be active for any sending to +  be performed at all.</p> + </dd> + <dt class='head--doc'>Bugs</dt> + <dd class='body--doc'><p>FIXME: Support for timeouts?</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File-&gt;set_nonblocking()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>`[]</b></span> + <span class='homogen--name'><b>simplify_path</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> res = <code class='class'>ADT.Table.table()</code>[&#32;<code class='class'>column</code>&#32;]</code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>simplify_path</span>(</b><code class='datatype'>string</code> <code class='argument'>path</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Same as <code>col()</code>.</p> + <dd class='body--doc'><p>Returns a canonic representation of <code>path</code> (without /./, /../, // +  and similar path segments).</p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>append_bottom</b></span> + <dt class='head--type'><span class='homogen--type'>Variable</span> + <span class='homogen--name'><b>stderr</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>append_bottom</span>(</b><code class='datatype'>object</code> <code class='argument'>table</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>File</code> Stdio.<b><span class='variable'>stderr</span></b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method appends two tables. The table given as an argument will be -  added at the bottom of the current table. Note, the column names must -  be equal. The column name comparison is case insensitive.</p> + <dd class='body--doc'><p>An instance of FILE("stderr"), the standard error stream. Use this +  when you want to output error messages.</p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>append_right</b></span> + <dt class='head--type'><span class='homogen--type'>Variable</span> + <span class='homogen--name'><b>stdout</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>append_right</span>(</b><code class='datatype'>object</code> <code class='argument'>table</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>File</code> Stdio.<b><span class='variable'>stdout</span></b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method appends two tables. The table given as an argument will be -  added on the right side of the current table. Note that the number of -  rows in both tables must be equal.</p> + <dd class='body--doc'><p>An instance of FILE("stdout"), the standatd output stream. Use this +  when you want to write anything to the standard output.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>col</b></span> + <span class='homogen--name'><b>werror</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>col</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> <code class='argument'>column</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>werror</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>This method returns the contents of a given column as an array.</p> + <dd class='body--doc'><p>Write a message to stderr. Stderr is normally the console, even if +  the process output has been redirected to a file or pipe.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>create</b></span> + <span class='homogen--name'><b>write_file</b></span>   </dt> - <dd><p><code><span class='object'>ADT.Table.table</span> <span class='class'>ADT.Table.table</span><b>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>) <code class='argument'>table</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>column_names</code>, <code class='datatype'>array</code>(<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>))|<code class='datatype'>void</code> <code class='argument'>column_types</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>write_file</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>str</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>access</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The <code>ADT.Table.table</code> class takes two or three arguments:</p> + <dd class='body--doc'><p>Write the string <code>str</code> onto the file <code>filename</code>. Any existing +  data in the file is overwritten.</p> + <p> For a description of <code>access</code>, see <code>Stdio.File()-&gt;open()</code>.</p>   </dd> - <dt class='head--doc'><span id='p-table'></span>Parameter <code class='parameter'>table</code></dt> - <dd></dd><dd class='body--doc'><p>The first argument is a two-dimensional array consisting of -  one array of columns per row. All rows must have the same -  number of columns as specified in <code>column_names</code>.</p> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p>Throws an error if <code>filename</code> couldn't be opened for writing.</p>   </dd> - <dt class='head--doc'><span id='p-column_names'></span>Parameter <code class='parameter'>column_names</code></dt> - <dd></dd><dd class='body--doc'><p>This argument is an array of column names associated with each -  column in the table. References by column name are case insensitive. -  The case used in <code>column_names</code> will be used when the table is -  displayed. A column can also be referred to by its position, -  starting from zero.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns the number of bytes written.</p>   </dd> - <dt class='head--doc'><span id='p-column_types'></span>Parameter <code class='parameter'>column_types</code></dt> - <dd></dd><dd class='body--doc'><p>This is an optional array of mappings. The column type -  information is only used when displaying the table. Currently, only the -  keyword <tt>"type"</tt> is recognized. The type can be specified as -  <tt>"text"</tt> or <tt>"num"</tt> (numerical). Text columns are left -  adjusted, whereas numerical columns are right adjusted. If a mapping -  in the array is 0 (zero), it will be assumed to be a text column. -  If <code>column_types</code> is omitted, all columns will displayed as text.</p> - <p> See <code>ADT.Table.ASCII.encode()</code> on how to display a table.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>append_file()</code>, <code>read_bytes()</code>, <code>Stdio.File()-&gt;open()</code></p> + </dd></dl> + <dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.BlockFile</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The Stdio.BlockFile API.</p> + <p> This class exists purely for typing reasons.</p> + <p> Use in types in place of <code>Stdio.File</code> where only blocking +  I/O is done with the object.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>ADT.Table.ASCII.encode()</code></p> + <dd class='body--doc'><p><code>Stream</code>, <code>NonblockingStream</code>, <code>File</code>, <code>FILE</code></p>   </dd></dl>    -  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>Stream</b></span> + </dt> + <dd><p><code><span class='datatype'>inherit Stream</span> : <span class='inherit'>Stream</span></code></p></dd> + </dl> + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.FakeFile</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>A string wrapper that pretends to be a <code>Stdio.File</code> object.</p> + </dd></dl>      <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>decode</b></span> + <span class='homogen--name'><b>close</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>decode</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>close</span>(</b><code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>direction</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns a table object from a binary string -  representation of a table, as returned by <code>encode()</code>.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;close()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>distinct</b></span> + <span class='homogen--name'><b>create</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>distinct</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> ... <code class='argument'>columns</code><b>)</b></code></p></dd> + <dd><p><code><span class='object'>Stdio.FakeFile</span> <span class='class'>Stdio.FakeFile</span><b>(</b><code class='datatype'>string</code> <code class='argument'>data</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>type</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>pointer</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method groups by the given columns and returns a table with only -  unique rows. When no columns are given, all rows will be unique. A new -  table object will be returned.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;create()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>encode</b></span> + <span class='homogen--name'><b>dup</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>encode</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>this_program</code> <b><span class='method'>dup</span>(</b><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns a binary string representation of the table. It is -  useful when one wants to store a the table, for example in a file.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;dup()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>group</b></span> + <span class='homogen--name'><b>errno</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>group</span>(</b><code class='datatype'>mapping</code>(<code class='datatype'>int</code>|<code class='datatype'>string</code>:<code class='datatype'>function</code>(:<code class='datatype void'>void</code>))|<code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>errno</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method calls the function <code>f</code> for each column each time a -  non uniqe row will be joined. The table will be grouped by the -  columns not listed. The result will be returned as a new table object.</p> + <dd class='body--doc'><p>Always returns 0.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;errno()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>limit</b></span> + <dt class='head--type'><span class='homogen--type'>Constant</span> + <span class='homogen--name'><b>is_fake_file</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>limit</span>(</b><code class='datatype'>int</code> <code class='argument'>n</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>constant</code> <code class='datatype'>int</code> Stdio.FakeFile.<code class='constant'>is_fake_file</code></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method truncates the table to the first <code>n</code> rows and returns -  a new object.</p> + <dd class='body--doc'><p>This constant can be used to distinguish a FakeFile object +  from a real <code>Stdio.File</code> object.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>map</b></span> + <span class='homogen--name'><b>line_iterator</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>map</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code>, <code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>string</code>)|<code class='datatype'>int</code>|<code class='datatype'>string</code> <code class='argument'>columns</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>String.SplitIterator</code> <b><span class='method'>line_iterator</span>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>trim</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method calls the function <code>f</code> for all rows in the table. -  The value returned will replace the values in the columns given -  as argument to map. If the function returns an array, several -  columns will be replaced. Otherwise the first column will be -  replaced. The result will be returned as a new table object.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;line_iterator()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>remove</b></span> + <span class='homogen--name'><b>peek</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>remove</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> ... <code class='argument'>columns</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int(-1..1)</code> <b><span class='method'>peek</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>timeout</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Like <code>select()</code>, but the given <code>columns</code> will not be in the -  resulting table.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;peek()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>rename</b></span> + <span class='homogen--name'><b>query_address</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>rename</span>(</b><code class='datatype'>string</code>|<code class='datatype'>int</code> <code class='argument'>from</code>, <code class='datatype'>string</code> <code class='argument'>to</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int(0..0)</code> <b><span class='method'>query_address</span>(</b><code class='datatype'>void</code>|<code class='datatype'>bool</code> <code class='argument'>is_local</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method renames the column named <code>from</code> to <code>to</code> and -  returns a new table object. Note that <code>from</code> can be the column -  position.</p> + <dd class='body--doc'><p>Always returns 0.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;query_address()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>reverse</b></span> + <span class='homogen--name'><b>query_id</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>reverse</span>(</b><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>mixed</code> <b><span class='method'>query_id</span>(</b><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method reverses the rows of the table and returns a -  new table object.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;query_id()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>row</b></span> + <span class='homogen--name'><b>read</b></span>   </dt> - <dd><p><code><code class='datatype'>array</code> <b><span class='method'>row</span>(</b><code class='datatype'>int</code> <code class='argument'>row_number</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>read</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int(0..)</code> <code class='argument'>len</code>, <code class='datatype'>void</code>|<code class='datatype'>bool</code> <code class='argument'>not_all</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns the contents of a given row as an array.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;read()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>rsort</b></span> + <span class='homogen--name'><b>read_function</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>rsort</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> ... <code class='argument'>columns</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>function</code>(:<code class='datatype'>string</code>) <b><span class='method'>read_function</span>(</b><code class='datatype'>int</code> <code class='argument'>nbytes</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Like <code>sort()</code>, but in descending order.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;read_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>select</b></span> + <span class='homogen--name'><b>seek</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>select</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> ... <code class='argument'>columns</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>seek</span>(</b><code class='datatype'>int</code> <code class='argument'>pos</code>, <code class='datatype'>int</code> <code class='argument'>mult</code>, <code class='datatype'>int</code> <code class='argument'>add</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns a new table object with the selected columns only.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;seek()</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> + <span class='homogen--name'><b>set_id</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>sort</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> ... <code class='argument'>columns</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_id</span>(</b><code class='datatype'>mixed</code> <code class='argument'>_id</code><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method sorts the table in ascendent order on one or several columns -  and returns a new table object. The left most column is sorted last. Note -  that the sort is stable.</p> - </dd> +    <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>rsort()</code></p> + <dd class='body--doc'><p><code>Stdio.File()-&gt;set_id()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>sum</b></span> + <span class='homogen--name'><b>tell</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>sum</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> ... <code class='argument'>columns</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>tell</span>(</b><b>)</b></code></p></dd>    - <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method sums all equal rows. The table will be grouped by the -  columns not listed. The result will be returned as a new table object.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;tell()</code></p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>type</b></span> + <span class='homogen--name'><b>truncate</b></span>   </dt> - <dd><p><code><code class='datatype'>mapping</code> <b><span class='method'>type</span>(</b><code class='datatype'>int</code>|<code class='datatype'>string</code> <code class='argument'>column</code>, <code class='datatype'>void</code>|<code class='datatype'>mapping</code> <code class='argument'>type</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>truncate</span>(</b><code class='datatype'>int</code> <code class='argument'>length</code><b>)</b></code></p></dd>    -  + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stdio.File()-&gt;truncate()</code></p> + </dd></dl> + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.NonblockingStream</b></h2> + </dt><dd><dl class='group--doc'>   <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method gives the type for the given <code>column</code>.</p> - <p> If a second argument is given, the old type will be replaced -  with <code>type</code>. The column type is only used when the table is displayed. -  The format is as specified in <code>create()</code>.</p> + <dd class='body--doc'><p>The Stdio.NonblockingStream API.</p> + <p> This class exists purely for typing reasons.</p> + <p> Use in types in place of <code>Stdio.File</code> where nonblocking and/or blocking +  stream-oriented I/O is done with the object.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>Stream</code>, <code>BlockFile</code>, <code>File</code>, <code>FILE</code></p>   </dd></dl>    -  +    <hr />   <dl class='group--doc'> - <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>where</b></span> + <dt class='head--type'><span class='homogen--type'>Inherit</span> + <span class='homogen--name'><b>Stream</b></span>   </dt> - <dd><p><code><code class='datatype'>object</code> <b><span class='method'>where</span>(</b><code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>string</code>)|<code class='datatype'>int</code>|<code class='datatype'>string</code> <code class='argument'>columns</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><b>)</b></code></p></dd> -  + <dd><p><code><span class='datatype'>inherit Stream</span> : <span class='inherit'>Stream</span></code></p></dd> + </dl> + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Stat</b></h2> + </dt><dd><dl class='group--doc'>   <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method calls the function for each row. If the function -  returns zero, the row will be thrown away. If the function -  returns something non-zero, the row will be kept. The result -  will be returned as a new table object.</p> + <dd class='body--doc'><p>This object is used to represent file status information +  from e.g. <code>file_stat()</code>.</p> + <p> It contains the following items usually found in a C <tt>struct +  stat</tt>:</p> + <dl class='group--doc'><dt>mode</dt> + <dd><p>File mode (see <tt>mknod(2)</tt>).</p> + </dd> + <dt>size</dt> + <dd><p>File size in bytes.</p> + </dd> + <dt>uid</dt> + <dd><p>User ID of the file's owner.</p> + </dd> + <dt>gid</dt> + <dd><p>Group ID of the file's owner.</p> + </dd> + <dt>atime</dt> + <dd><p>Time of last access in seconds since 00:00:00 UTC, 1970-01-01.</p> + </dd> + <dt>mtime</dt> + <dd><p>Time of last data modification.</p> + </dd> + <dt>ctime</dt> + <dd><p>Time of last file status change.</p> + </dd> + <dt>ino</dt> + <dd><p>Inode number.</p> + </dd> + <dt>nlink</dt> + <dd><p>Number of links.</p> + </dd> + <dt>dev</dt> + <dd><p>ID of the device containing a directory entry for this file.</p> + </dd> + <dt>rdev</dt> + <dd><p>ID of the device.</p> + </dd> + </dl><p>It also contains some items that correspond to the C <tt>IS*</tt> macros:</p> + <dl class='group--doc'><dt>isreg</dt> + <dd><p>Set if the file is a regular file.</p> + </dd> + <dt>isdir</dt> + <dd><p>Set if the file is a directory.</p> + </dd> + <dt>islnk</dt> + <dd><p>Set if the file is a symbolic link. Note that symbolic links +  are normally followed by the stat functions, so this might +  only be set if you turn that off, e.g. by giving a nonzero +  second argument to <code>file_stat()</code>.</p> + </dd> + <dt>isfifo</dt> + <dd><p>Set if the file is a FIFO (aka named pipe).</p> + </dd> + <dt>issock</dt> + <dd><p>Set if the file is a socket.</p> + </dd> + <dt>ischr</dt> + <dd><p>Set if the file is a character device.</p> + </dd> + <dt>isblk</dt> + <dd><p>Set if the file is a block device.</p> + </dd> + </dl><p>There are also some items that provide alternative representations +  of the above:</p> + <dl class='group--doc'><dt>type</dt> + <dd><p>The type as a string, can be any of <tt>"reg"</tt>, +  <tt>"dir"</tt>, <tt>"lnk"</tt>, <tt>"fifo"</tt>, <tt>"sock"</tt>, +  <tt>"chr"</tt>, <tt>"blk"</tt>, and <tt>"unknown"</tt>.</p> + </dd> + <dt>mode_string</dt> + <dd><p>The file mode encoded as a string in <tt>ls -l</tt> style, e.g. +  <tt>"drwxr-xr-x"</tt>.</p> + </dd> + </dl><p>Note that some items might not exist or have meaningful values +  on some platforms.</p> + <p> Additionally, the object may be initialized from or casted to an +  <tt>array</tt> on the form of a 'traditional' LPC stat-array, and +  it's also possible to index the object directly with integers as +  if it were such an array. The stat-array has this format:</p> + <table class='box'><tr><td colspan='2'>Array</td></tr> + <tr><td><code><code class='datatype'>int</code> <code class='key'>0</code></code></td><td><p>File mode, same as <tt>mode</tt>.</p> + </td></tr> + <tr><td><code><code class='datatype'>int</code> <code class='key'>1</code></code></td><td><p>If zero or greater, the file is a regular file and this is +  its size in bytes. If less than zero it gives the type: +  -2=directory, -3=symlink and -4=device.</p> + </td></tr> + <tr><td><code><code class='datatype'>int</code> <code class='key'>2</code></code></td><td><p>Time of last access, same as <tt>atime</tt>.</p> + </td></tr> + <tr><td><code><code class='datatype'>int</code> <code class='key'>3</code></code></td><td><p>Time of last data modification, same as <tt>mtime</tt>.</p> + </td></tr> + <tr><td><code><code class='datatype'>int</code> <code class='key'>4</code></code></td><td><p>Time of last file status change, same as <tt>ctime</tt>.</p> + </td></tr> + <tr><td><code><code class='datatype'>int</code> <code class='key'>5</code></code></td><td><p>User ID of the file's owner, same as <tt>uid</tt>.</p> + </td></tr> + <tr><td><code><code class='datatype'>int</code> <code class='key'>6</code></code></td><td><p>Group ID of the file's owner, same as <tt>gid</tt>.</p> + </td></tr> + </table><p>It's possible to modify the stat struct by assigning values to +  the items. They essentially work as variables, although some of +  them affect others, e.g. setting <tt>isdir</tt> clears <tt>isreg</tt> +  and setting <tt>mode_string</tt> changes many of the other items.</p>   </dd></dl> - </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>ADT.Table.ASCII</b></h2> - </dt><dd> +       <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>encode</b></span> + <span class='homogen--name'><b>create</b></span>   </dt> - <dd><p><code><code class='datatype'>string</code> <b><span class='method'>encode</span>(</b><code class='datatype'>object</code> <code class='argument'>table</code>, <code class='datatype'>void</code>|<code class='datatype'>mapping</code> <code class='argument'>options</code><b>)</b></code></p></dd> + <dd><p><code><span class='object'>Stdio.Stat</span> <span class='class'>Stdio.Stat</span><b>(</b><code class='datatype'>void</code>|<code class='datatype'>object</code>|<code class='datatype'>array</code> <code class='argument'>stat</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>This method returns a table represented in ASCII suitable for human eyes. -  <code>options</code> is an optional mapping. If the keyword <tt>"indent"</tt> is used -  with a number, the table will be indented with that number of space -  characters.</p> - </dd></dl> + <dd class='body--doc'><p>A new <code>Stdio.Stat</code> object can be initialized in two ways:</p> + <ul> + <li><p><code>stat</code> is an object, typically another <code>Stdio.Stat</code>. The +  stat info is copied from the object by getting the values of +  <tt>mode</tt>, <tt>size</tt>, <tt>atime</tt>, <tt>mtime</tt>, <tt>ctime</tt>, +  <tt>uid</tt>, <tt>gid</tt>, <tt>dev</tt>, <tt>ino</tt>, <tt>nlink</tt>, and +  <tt>rdev</tt>.</p> + </li><li><p><code>stat</code> is a seven element array on the 'traditional' LPC +  stat-array form (see the class doc).</p> + </li></ul></dd></dl> + </dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Stream</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The Stdio.Stream API.</p> + <p> This class exists purely for typing reasons.</p> + <p> Use in types in place of <code>Stdio.File</code> where only blocking stream-oriented +  I/O is done with the object.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>NonblockingStream</code>, <code>BlockFile</code>, <code>File</code>, <code>FILE</code></p>   </dd></dl></dd></dl></dd></dl></dd></dl></body></html>