Branch: Tag:

1996-02-24

1996-02-24 02:42:05 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

Garbage collect finished

Rev: lib/simulate.lpc:1.9
Rev: src/ChangeLog:1.17
Rev: src/Makefile.in:1.9
Rev: src/array.c:1.7
Rev: src/array.h:1.4
Rev: src/backend.c:1.3
Rev: src/backend.h:1.3
Rev: src/builtin_efuns.c:1.10
Rev: src/call_out.c:1.3
Rev: src/config.h:1.3
Rev: src/debug.c:1.2(DEAD)
Rev: src/debug.h:1.2(DEAD)
Rev: src/global.h:1.2
Rev: src/mapping.c:1.3
Rev: src/mapping.h:1.2
Rev: src/modules/efuns.c:1.2(DEAD)
Rev: src/modules/files/Makefile.in:1.2
Rev: src/modules/regexp/Makefile.in:1.2
Rev: src/modules/sprintf/Makefile.in:1.2
Rev: src/object.c:1.6
Rev: src/object.h:1.4
Rev: src/program.c:1.7
Rev: src/program.h:1.3
Rev: src/stralloc.c:1.2
Rev: src/stralloc.h:1.2
Rev: src/svalue.c:1.6
Rev: src/svalue.h:1.4
Rev: src/test/create_testsuite:1.8

1:   <?xml version='1.0' encoding='utf-8'?>   <autodoc> + <namespace name='cpp'> + <doc placeholder='true'> + <text> + <p><tt>preprocessor</tt> - textually process code before compiling</p> +  + <p>µLPC has a builtin C-style preprocessor. It works similar to old + C preprocessors but has a few extra features. This file describes + the different preprocessor directives.</p> +  + <tt><p><dl><group><text>#!<br/> + #define<br/> + #elif<br/> + #else<br/> + #elseif<br/> + #endif<br/> + #error<br/> + #if<br/> + #ifdef<br/> + #ifndef<br/> + #include<br/> + #line<br/> + #pragma<br/> + #undef<br/> + </text></group></dl> + </p> + <p><br/> + </p> + </tt></text> +  + </doc> + <docgroup homogen-name='#!' homogen-type='directive'> + <directive name='#!'> + </directive> + <doc placeholder='true'> + <text> +  + <p>This directive is in effect a comment statement, since the + preprocessor will ignore everything to the end of the line. + This is used to write unix type scripts in µLPC by starting + the script with + </p> + <p>#!/usr/local/bin/ulpc + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='#define' homogen-type='directive'> + <directive name='#define'> + </directive> + <doc placeholder='true'> + <text> +  + <p>The simplest way to use define is to write + </p> + <p><dl><group><text>#define &lt;identifier&gt; &lt;replacement string&gt;<br/> + </text></group></dl> + </p> + <p>which will cause all subsequent occurances of 'identifier' to be + replaced with the replacement string. + </p> + <p>Define also has the capability to use arguments, thus a line like + </p> + <p><dl><group><text>#define &lt;identifier&gt;(arg1, arg2) &lt;replacement string&gt;<br/> + </text></group></dl> + </p> + <p>would cause identifer to be a macro. All occurances of + 'identifier(something1,something2d)' would be replaced with + the replacement string. And in the replacement string, arg1 and arg2 + will be replaced with something1 and something2. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-type='directive'> + <directive name='#if'> + </directive> + <directive name='#elif'> + </directive> + <directive name='#elseif'> + </directive> + <directive name='#else'> + </directive> + <directive name='#endif'> + </directive> + <doc placeholder='true'> + <text> +  + <p>The #if directive causes conditional compiling of code depending on + the expression after the #if directive. That is, if the expression + is true, the code up to the next #else, #elif, #elseif or #endif is + compiled. If the expression is false, that code will be skipped. + If the skip leads up to a #else, the code after the else will be + compiled. #elif and #elseif are equivialent and causes the code that + follow them to be compiled if the previous #if or #elif evaluated + false and the expression after the #elif evaluates true. + </p> + <p>Expressions given to #if, #elif or #endif are special, all identifiers + evaluate to zero unless they are defined to something else. Integers, + strings and floats are the only types that can be used, but all lpc + operators can be used on these types. + </p> + <p>Also, two special functions can be used, defined() and efun(). + defined(&lt;identifer&gt;) expands to '1' if the identifier is defined, + '0' otherwise. efun(&lt;identifier&gt;) expands to '1' if identifer is + an efun, '0' otherwise.</p> + </text> +  + <group><example/><text> + <tt><p>#if 1<br/> + <dl><group><text>write("foo");<br/> + </text></group></dl>#else<br/> + <dl><group><text>write("bar");<br/> + </text></group></dl>#endif<br/> +  + </p> + <p>#if defined(FOO)<br/> + <dl><group><text>write(FOO);<br/> + </text></group></dl>#elif defined(BAR)<br/> + <dl><group><text>write(BAR);<br/> + </text></group></dl>#else<br/> + <dl><group><text>write("default");<br/> + </text></group></dl>#endif<br/> +  + </p> + <p>#if !efun(write_file)<br/> + inherit "simulate.lpc"<br/> + #endif<br/> + <br/> + </p> + </tt></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='#error' homogen-type='directive'> + <directive name='#error'> + </directive> + <doc placeholder='true'> + <text> +  + <p>This directive causes a compiler error, it can be used to notify + the user that certain efuns are missing and similar things.</p> + </text> +  + <group><example/><text> + <tt><p>#if !efun(write_file)<br/> + #error Move object is missing<br/> + #endif<br/> + <br/> + </p> + </tt></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='#include' homogen-type='directive'> + <directive name='#include'> + </directive> + <doc placeholder='true'> + <text> +  + <p>This directive should be given a file as argument, it will then be + compiled as if all those lines were written at the #include line. + The compiler then continues to compile this file.</p> + </text> +  + <group><example/><text> + <tt><p>#include "foo.h"<br/> + <br/> + </p> + </tt></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='#line' homogen-type='directive'> + <directive name='#line'> + </directive> + <doc placeholder='true'> + <text> +  + <p>This directive tells the compiler what line and file we are compiling. + This is for instance used by the #include directive to tell the + compiler that we are compiling another file. The directive takes + the line number first, and optionally, the file afterwards. + </p> + <p>This can also be used when generating lpc from something else, to + tell teh compiler where the code originally originated from.</p> + </text> +  + <group><example/><text> + <tt><p>#line 4 "foo.cf" /* The next line was generated from 4 in foo.cf */<br/> + <br/> + </p> + </tt></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='#pragma' homogen-type='directive'> + <directive name='#pragma'> + </directive> + <doc placeholder='true'> + <text> +  + <p>This is a generic directive for flags to the compiler. Currently, the + only flag available is 'all_inline' which is the same as adding the + modifier 'inline' to all functions that follows. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='#undef' homogen-type='directive'> + <directive name='#undef'> + </directive> + <doc placeholder='true'> + <text> +  + <p>This removes the effect of a #define, all subsequent occurances of + the undefined identifier will not be replaced by anything. Note that + when undefining a macro, you just give the identifer, not the + arguments.</p> + </text> +  + <group><example/><text> + <tt><p>#define foo bar<br/> + #undef foo<br/> + #define foo(bar) gazonk bar<br/> + #undef foo<br/> + <br/> + </p> + </tt></text></group> +  + </doc> + </docgroup> + </namespace>   <namespace name='predef'>   <docgroup homogen-name='PI' homogen-type='constant'>   <constant name='PI'/><doc placeholder='true'>
24:   </p>   </tt>   <p>Return the arcus cosinus value for f.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::cos' to='predef::cos'>math/cos</ref> and <ref resolved='predef::asin' to='predef::asin'>math/asin</ref></p>   </text></group>
203:   <text>   <p><tt>allocate</tt> - allocate an array</p>    - <tt><p>mixed *allocate(int <i>size</i>, [ string <i>type</i> ]);<br/> + <tt><p>mixed *allocate(int <i>size</i>);<br/>   </p>   </tt> - <p>Allocate an array of size elements. Optionally, write what type you - want to store in the array in the second argument as a string. - Note that the type given in this string should be simple, instead - of writing "int ***" just write "array".</p> + <p>Allocate an array of size elements and initialize them to zero.</p>   </text>      <group><example/><text>   <tt><p>mixed *a=allocate(17);<br/> - int *b=allocate(17, "int");<br/> - int **c=allocate(17, "array");<br/> - mapping *c=allocate(17, "mapping");<br/> - array (list (int)) c=allocate(17, "list");<br/> - array (string) c=allocate(17, "string");<br/> +    </p>   </tt></text></group>   
309:   </p>   </tt>   <p>Return the arcus sinus value for f.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::sin' to='predef::sin'>math/sin</ref> and <ref resolved='predef::acos' to='predef::acos'>math/acos</ref></p>   </text></group>
326:   </p>   </tt>   <p>Return the arcus tangent value for f.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::tan' to='predef::tan'>math/tan</ref>, <ref resolved='predef::asin' to='predef::asin'>math/asin</ref> and <ref resolved='predef::acos' to='predef::acos'>math/acos</ref></p>   </text></group>
365:      </doc>   </docgroup> + <docgroup homogen-name='break' homogen-type='method'> + <method name='break'/><doc placeholder='true'> + <text> + <p><tt>break</tt> - break a loop or switch</p> +  + <tt><p>break<br/> + </p> + </tt> + <p>Break jumps directly out of any loop or switch statement, it is + a very vital part of every switch statement.</p> +  + control</text> +  + <group><seealso/><text> + <p><ref to='do-while'>do-while</ref>, <ref resolved='predef::while' to='while'>while</ref>, <ref resolved='predef::for' to='for'>for</ref> and <ref resolved='predef::switch' to='switch'>switch</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='call_function' homogen-type='method'>   <method name='call_function'/><doc placeholder='true'>   <text>
496:      </doc>   </docgroup> + <docgroup homogen-name='catch' homogen-type='method'> + <method name='catch'/><doc placeholder='true'> + <text> + <p><tt>catch</tt> - catch errors</p> +  + <tt><p>catch { commands }<br/> + or<br/> + catch ( expression )<br/> + </p> + </tt> + <p>catch traps exceptions such as run time errors or calls to throw() and + returns the argument given to throw. For a run time error, this value + is ({ "error message", backtrace }) </p> +  + control</text> +  + <group><seealso/><text> + <p><ref resolved='predef::throw' to='predef::throw'>builtin/throw</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='cd' homogen-type='method'>   <method name='cd'/><doc placeholder='true'>   <text>
506:   </tt>   <p>Change the current directory for the whole LPC process, return   1 for success, 0 otherwise.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::getcwd' to='predef::getcwd'>files/getcwd</ref></p>   </text></group>
524:   </tt>   <p>Return the closest integral value higher or equal to x.   Note that ceil() does _not_ return an int, merely an integral value.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::floor' to='predef::floor'>math/floor</ref></p>   </text></group>      </doc>   </docgroup> -  + <docgroup homogen-name='class' homogen-type='method'> + <method name='class'/><doc placeholder='true'> + <text> + <p><tt>class</tt> - define a inlined program</p> +  + <tt><p>class { program definition }<br/> + </p> + </tt> + <p>Class is a way of writing serveral programs in one file. + The program written between the brackets will be returned by + class.</p> + </text> +  + <group><example/><text> + <tt><p>complex=clone(class { float r, i; });<br/> + complex-&gt;r=1.0;<br/> + complex-&gt;i=1.0;<br/> + </p> + </tt> + lpc</text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::inherit' to='inherit'>inherit</ref> and <ref resolved='predef::lambda' to='lambda'>lambda</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='clone' homogen-type='method'>   <method name='clone'/><doc placeholder='true'>   <text>
638:      </doc>   </docgroup> + <docgroup homogen-name='continue' homogen-type='method'> + <method name='continue'/><doc placeholder='true'> + <text> + <p><tt>continue</tt> - continue a loop</p> +  + <tt><p>continue<br/> + </p> + </tt> + <p>Continue work similarly to break only it does't finish the loop, + it just aborts the rest of this turn in the loop. </p> +  + control</text> +  + <group><seealso/><text> + <p><ref to='do-while'>do-while</ref>, <ref resolved='predef::while' to='while'>while</ref> and <ref resolved='predef::for' to='for'>for</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='copy_value' homogen-type='method'>   <method name='copy_value'/><doc placeholder='true'>   <text>
668:   </p>   </tt>   <p>Return the cosinus value for f.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::acos' to='predef::acos'>math/acos</ref> and <ref resolved='predef::sin' to='predef::sin'>math/sin</ref></p>   </text></group>
769:      </doc>   </docgroup> + <docgroup homogen-name='do-while' homogen-type='method'> + <method name='do-while'/><doc placeholder='true'> + <text> + <p><tt>do-while</tt> - execute a statement while an expression is true</p> +  + <tt><p>do <i>statement</i> while ( <i>expression</i> );<br/> + </p> + </tt> + <p>do - while only differs from the ordinary while-loop in that it does + _not_ evaluate the expression until after the statement has been + executed once. Thus it always runs the statement once.</p> + </text> +  + <group><example/><text> + <tt><p>int i=circular_buffer_pos;<br/> + do<br/> + {<br/> + <dl><group><text>write(circular_buffer[i]);<br/> + i=(i+1) % sizeof(circular_buffer);<br/> + </text></group></dl>}while(i != circular_buffer_pos);<br/> + </p> + </tt> + control</text></group> +  + <group><seealso/><text> + <p><ref to='do-while'>do-while</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='equal' homogen-type='method'>   <method name='equal'/><doc placeholder='true'>   <text>
885:   </tt>   <p>Return the natural exponent of f.   log( exp( x ) ) == x as long as exp(x) doesn't overflow an int.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::pow' to='predef::pow'>math/pow</ref> and <ref resolved='predef::log' to='predef::log'>math/log</ref></p>   </text></group>
960:   int *file-&gt;stat();<br/>   </p>   </tt> - <p><matrix> - <r><c> file_stat returns an array of integers describing some properties </c></r> - <r><c> about the file. </c><c> Currently file_stat return 5 entries: </c></r> - <r><c> ({ </c></r> + <p>file_stat returns an array of integers describing some properties<br/> + about the file. Currently file_stat return 7 entries:<br/> + ({<br/> + <dl><group><text><matrix> + <r><c> mode, </c><c> /* file mode, protection bits etc. etc. */ </c></r> + <r><c> size, </c><c> /* file size for regular files, -2 for dirs, -3 for links, -4 for otherwise */ </c></r> + <r><c> atime, </c><c> /* last access time */ </c></r> + <r><c> mtime, </c><c> /* last modify time */ </c></r> + <r><c> ctime, </c><c> /* last status time change */ </c></r> + <r><c> uid, </c><c> /* The user who owns this file */ </c></r> + <r><c> gid </c><c> /* The group this file belongs to */ </c></r>   </matrix> - <dl><group><text>mode, /* file mode, protection bits etc. etc. */<br/> - size, /* file size for regular files,<br/> - <dl><group><text>* -2 for dirs,<br/> - * -3 for links,<br/> - * -4 for otherwise<br/> - */<br/> - </text></group></dl>atime, /* last access time */<br/> - mtime, /* last modify time */<br/> - ctime, /* last status time change */<br/> - uid, /* The user who owns this file */<br/> - gid /* The group this file belongs to */<br/> +    </text></group></dl>})<br/>   If you give 1 as a second argument, stat does not follow links.<br/>   You can never get -3 as size if you don't give a second argument.<br/>      </p>   <p>If there is no such file or directory, zero is returned.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::get_dir' to='predef::get_dir'>files/get_dir</ref></p>   </text></group>
1114:   </tt>   <p>Return the closest integral value lower or equal to x.   Note that floor() does _not_ return an int, merely an integral value.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::ceil' to='predef::ceil'>math/ceil</ref></p>   </text></group>      </doc>   </docgroup> -  + <docgroup homogen-name='for' homogen-type='method'> + <method name='for'/><doc placeholder='true'> + <text> + <p><tt>for</tt> - generic loop statement</p> +  + <tt><p>for ( expression1 ; expression2 ; expression3 ) <i>statement</i><br/> + </p> + </tt> + <p>the above statement is exactly equal to: + </p> + <p>expression1;<br/> + while( expression2 )<br/> + {<br/> + <dl><group><text>&lt;statement&gt;<br/> + expression3;<br/> + </text></group></dl>}<br/> +  + </p> + <p>Except when using 'continue'. When using continue in &lt;statement&gt; + expresstion3 will not be called.</p> + </text> +  + <group><example/><text> + <tt><p>int e;<br/> + for(e=0;e&lt;10;e++) write(e+"\n");<br/> + </p> + </tt> + control</text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::while' to='while'>while</ref>, <ref resolved='predef::break' to='break'>break</ref> and <ref resolved='predef::continue' to='continue'>continue</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='foreach' homogen-type='method'> + <method name='foreach'/><doc placeholder='true'> + <text> + <p><tt>foreach</tt> - loop over an array</p> +  + <tt><p>foreach ( array, variable ) statement<br/> + </p> + </tt> + <p>For each element in array, set variable to that value and execute + 'statement'.</p> + </text> +  + <group><example/><text> + <tt><p>string word;<br/> + foreach( explode(sentence," "), word) foo(word);<br/> + </p> + </tt> + control</text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::for' to='for'>for</ref> and <ref resolved='predef::while' to='while'>while</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='fork' homogen-type='method'>   <method name='fork'/><doc placeholder='true'>   <text>
1305:   lpc</text></group>      <group><seealso/><text> - <p><ref resolved='predef::lambda' to='lambda'>lambda</ref>, <ref to='return'>return</ref> and <ref to='modifier'>modifier</ref></p> + <p><ref resolved='predef::lambda' to='lambda'>lambda</ref>, <ref resolved='predef::return' to='return'>return</ref> and <ref to='modifier'>modifier</ref></p>   </text></group>      </doc>
1320:   </tt>   <p>Return an array of all filenames in the directory dir, or zero if   no such directory exists.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::mkdir' to='predef::mkdir'>files/mkdir</ref> and <ref resolved='predef::cd' to='predef::cd'>files/cd</ref></p>   </text></group>
1351:   </p>   </tt>   <p>getcwd returns the current working directory.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::cd' to='predef::cd'>files/cd</ref></p>   </text></group>
1453:   therefor all global variables are declared as mixed, whatever the   &lt;type&gt; may be.   </p> - <p><matrix> - <r><c> Evaluate a statement: </c></r> - <r><c> &lt;statement&gt; ; </c></r> - <r><c> Statements include the following examples: </c></r> - <r><c> </c><c> for(e=0;e&lt;10;e++) ; e=10; </c></r> - </matrix> -  + <p>Evaluate a statement: + &lt;statement&gt; ; + Statements include the following examples:   </p> - <p><matrix> - <r><c> </c><c> write(e); </c></r> - <r><c> </c></r> - </matrix> -  + <p><dl><group><text>for(e=0;e&lt;10;e++) ;<br/> + </text></group></dl>   </p> - <p><matrix> - <r><c> </c><c> if(foo) return bar; else return gazonk; </c></r> - <r><c> </c></r> - </matrix> -  + <p><dl><group><text>e=10;<br/> + </text></group></dl>   </p> -  + <p><dl><group><text>write(e);<br/> + </text></group></dl> + </p> + <p><dl><group><text>if(foo) return bar; else return gazonk;<br/> + </text></group></dl> + </p>   <p>Statements beginning with for, while, switch, if, do or return will - not automatically return anything, and no result will be printed.</p> + not automatically return anything, and no result will be printed. + </p>   </text>    -  + </doc> + </docgroup> + <docgroup homogen-name='if-else' homogen-type='method'> + <method name='if-else'/><doc placeholder='true'> + <text> + <p><tt>if-else</tt> - run on condition</p> +  + <tt><p>if( expression ) <i>statement</i><br/> + or<br/> + if( expression ) <i>statement</i> else <i>statement</i><br/> + </p> + </tt> + <p>If is the simplest of all control structures, in the first form + it runs the statement if the expression is true and in the second + form it runs the first statement if the expression is true and the + second if it is false.</p> +  + control</text> +    <group><seealso/><text> - <p><ref to='script_mode'>script_mode</ref></p> + <p><ref resolved='predef::switch' to='switch'>switch</ref></p>   </text></group>      </doc>
1594:   lpc</text></group>      <group><seealso/><text> - <p><ref to='class'>class</ref></p> + <p><ref resolved='predef::class' to='class'>class</ref></p>   </text></group>      </doc>
1782:   lpc</text></group>      <group><seealso/><text> - <p><ref to='class'>class</ref> and <ref resolved='predef::function' to='function'>function</ref></p> + <p><ref resolved='predef::class' to='class'>class</ref> and <ref resolved='predef::function' to='function'>function</ref></p>   </text></group>      </doc>
1851:   </tt>   <p>Return the natural logarithm of f.   exp( log(x) ) == x for x &gt; 0.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::pow' to='predef::pow'>math/pow</ref> and <ref resolved='predef::exp' to='predef::exp'>math/exp</ref></p>   </text></group>
2082:   </p>   </tt>   <p>Create a directory, return zero if it fails and nonzero if it fails.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::rm' to='predef::rm'>files/rm</ref> and <ref resolved='predef::cd' to='predef::cd'>files/cd</ref></p>   </text></group>
2149:   <p>Rename or move a file between directories. If the destination   file already exists, it will be overwritten. Returns 1 on sucess,   0 otherwise.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::rm' to='predef::rm'>files/rm</ref></p>   </text></group>
2296:   </p>   </tt>   <p>Return n raised to the power of x.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::exp' to='predef::exp'>math/exp</ref> and <ref resolved='predef::log' to='predef::log'>math/log</ref></p>   </text></group>
2553:      </doc>   </docgroup> + <docgroup homogen-name='return' homogen-type='method'> + <method name='return'/><doc placeholder='true'> + <text> + <p><tt>return</tt> - return from a function</p> +  + <tt><p>return<br/> + or<br/> + return <i>expression</i><br/> + </p> + </tt> + <p>Return jumps directly out of a function returning the given value to + the calling function. If no expression is given, 0 is returned.</p> +  + control</text> +  + </doc> + </docgroup>   <docgroup homogen-name='reverse' homogen-type='method'>   <method name='reverse'/><doc placeholder='true'>   <text>
2587:   </p>   </tt>   <p>Remove a file or directory, return 0 if it fails. Nonzero otherwise.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::mkdir' to='predef::mkdir'>files/mkdir</ref></p>   </text></group>
2792:   </p>   </tt>   <p>Return the sinus value for f.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::asin' to='predef::asin'>math/asin</ref> and <ref resolved='predef::cos' to='predef::cos'>math/cos</ref></p>   </text></group>
2893:   </tt>   <p>The format string is a string containing a description of how to   output the data in the rest of the arguments. This string should - generally speaking have one %&lt;modifyers&gt;&lt;operator&gt; (examples: + generally speaking have one %&lt;modifiers&gt;&lt;operator&gt; (examples:   %s, %0d, %-=20s) for each of the rest arguments.   </p> - <p>Modifyers:<br/> - <dl><group><text>0 Zero pad numbers (implies right justification)<br/> - ! Toggle truncation<br/> - ' ' (space) pad positive integers with a space<br/> - + pad positive integers with a plus sign<br/> - - left adjusted within field size (default is right)<br/> - | centered within field size<br/> - = column mode if strings are greater than field size<br/> - / Rough linebreak (break at exactly fieldsize instead of<br/> - <dl><group><text>between words)<br/> - </text></group></dl># table mode, print a list of '\n' separated word<br/> - <dl><group><text>(top-to-bottom order)<br/> - </text></group></dl>$ Inverse table mode (left-to-right order)<br/> - n (where n is a number or *) a number specifies field size<br/> - .n set precision<br/> - :n set field size &amp; precision<br/> - ;n Set column width<br/> - * if n is a * then next argument is used<br/> - 'X' Set a pad string. ' cannot be a part of the pad_string (yet)<br/> - &lt; Use same arg again<br/> - ^ repeat this on every line produced<br/> - @ do this format for each entry in argument array<br/> - &gt; Put the string at the bottom end of column instead of top<br/> - _ Set width to the length of data<br/> - </text></group></dl> + <p>Modifiers:   </p> - <p>Operators:<br/> - <dl><group><text>%% percent<br/> - %d signed decimal int<br/> - %u unsigned decimal int (doesn't really exist in lpc)<br/> - %o unsigned octal int<br/> - %x lowercase unsigned hexadecimal int<br/> - %X uppercase unsigned hexadecimal int<br/> - %c char<br/> - %f float<br/> - %g heruistically chosen representation of float<br/> - %e exponential notation float<br/> - %s string<br/> - %O any type (debug style)<br/> - %n nop<br/> - %t type of argument<br/> - %&lt;modifyers&gt;{format%} do a format for every index in an array.<br/> - </text></group></dl></p> + <p><matrix> + <r><c> 0 </c><c> Zero pad numbers (implies right justification) </c></r> + <r><c> ! </c><c> Toggle truncation </c></r> + <r><c> ' ' (space) </c><c> pad positive integers with a space </c></r> + <r><c> + </c><c> pad positive integers with a plus sign </c></r> + <r><c> - </c><c> left adjusted within field size (default is right) </c></r> + <r><c> | </c><c> centered within field size </c></r> + <r><c> = </c><c> column mode if strings are greater than field size </c></r> + <r><c> / </c><c> Rough linebreak (break at exactly fieldsize instead of between words) </c></r> + <r><c> # </c><c> table mode, print a list of '\n' separated word (top-to-bottom order) </c></r> + <r><c> $ </c><c> Inverse table mode (left-to-right order) </c></r> + <r><c> n </c><c> (where n is a number or *) a number specifies field size </c></r> + <r><c> .n </c><c> set precision </c></r> + <r><c> :n </c><c> set field size &amp; precision </c></r> + <r><c> ;n </c><c> Set column width </c></r> + <r><c> * </c><c> if n is a * then next argument is used </c></r> + <r><c> 'X' </c><c> Set a pad string. ' cannot be a part of the pad_string (yet) </c></r> + <r><c> &lt; </c><c> Use same arg again </c></r> + <r><c> ^ </c><c> repeat this on every line produced </c></r> + <r><c> @ </c><c> do this format for each entry in argument array </c></r> + <r><c> &gt; </c><c> Put the string at the bottom end of column instead of top </c></r> + <r><c> _ </c><c> Set width to the length of data </c></r> + </matrix> +  + </p> + <p>Operators: + </p> + <p><matrix> + <r><c> %% </c><c> percent </c></r> + <r><c> %d </c><c> signed decimal int </c></r> + <r><c> %u </c><c> unsigned decimal int (doesn't really exist in lpc) </c></r> + <r><c> %o </c><c> unsigned octal int </c></r> + <r><c> %x </c><c> lowercase unsigned hexadecimal int </c></r> + <r><c> %X </c><c> uppercase unsigned hexadecimal int </c></r> + <r><c> %c </c><c> char (or short with %2c, %3c gives 3 bytes etc.) </c></r> + <r><c> %f </c><c> float </c></r> + <r><c> %g </c><c> heruistically chosen representation of float </c></r> + <r><c> %e </c><c> exponential notation float </c></r> + <r><c> %s </c><c> string </c></r> + <r><c> %O </c><c> any type (debug style) </c></r> + <r><c> %n </c><c> nop </c></r> + <r><c> %t </c><c> type of argument </c></r> + <r><c> %&lt;modifiers&gt;{format%} </c><c> do a format for every index in an array. </c></r> + </matrix> + </p>   </text>      <group><example/><text>
3061:   &gt; quit<br/>   Exiting.<br/>   </p> - </tt></text></group> + </tt> + string</text></group>      <group><seealso/><text>   <p><ref resolved='predef::sscanf' to='sscanf'>sscanf</ref></p>
3081:   </tt>   <p>Return the square root of f, or in the second case, the square root   truncated to the closest lower integer.</p> - </text> +     -  + float and int</text> +    <group><seealso/><text>   <p><ref resolved='predef::pow' to='predef::pow'>math/pow</ref>, <ref resolved='predef::log' to='predef::log'>math/log</ref>, <ref resolved='predef::exp' to='predef::exp'>math/exp</ref> and <ref resolved='predef::floor' to='predef::floor'>math/floor</ref></p>   </text></group>
3287:      </doc>   </docgroup> + <docgroup homogen-name='switch' homogen-type='method'> + <method name='switch'/><doc placeholder='true'> + <text> + <p><tt>switch</tt> - Complicated conditional statement</p> +  + <tt><p>switch( expression )<br/> + {<br/> + <dl><group><text>case constant1:<br/> + <dl><group><text><i>statement1</i><br/> + </text></group></dl></text></group></dl><br/> + <dl><group><text>case constant2:<br/> + <dl><group><text><i>statement2</i><br/> + break;<br/> + </text></group></dl></text></group></dl><br/> + <dl><group><text>case constant3..constant4:<br/> + <dl><group><text><i>statement4</i><br/> + break;<br/> + </text></group></dl></text></group></dl><br/> + <dl><group><text>default:<br/> + <dl><group><text><i>statement3</i><br/> + </text></group></dl></text></group></dl>}<br/> + </p> + </tt> + <p>Switch evaluates the expression give and then executes one or more + statement accordingly to the result. If the result is equal to + constant1 then statement1 will be executed, please observe that + the second case-statement dos _not_ abort the execution in any way + instead statement2 will also be executed. After that break will + cause execution to continue after the after the last } in the + switch statement. If the result is equal to constant2 only + statement2 will be executed. If expression &lt;= consant3 and + expression &gt;= constant4, statement4 will be executed. In all other + cases statement3 is executed because it is 'default'. Please note + that the expression and constants can be any type that can be + written as a constant. Arrays, mappings and lists have little or + no use though.</p> +  + control</text> +  + <group><seealso/><text> + <p><ref to='if-else'>if-else</ref> and <ref resolved='predef::break' to='break'>break</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='system' homogen-type='method'>   <method name='system'/><doc placeholder='true'>   <text>
3315:   </p>   </tt>   <p>Return the tangent value for f.</p> - </text> +     -  + float</text> +    <group><seealso/><text>   <p><ref resolved='predef::atan' to='predef::atan'>math/atan</ref>, <ref resolved='predef::sin' to='predef::sin'>math/sin</ref> and <ref resolved='predef::cos' to='predef::cos'>math/cos</ref></p>   </text></group>
3533:      </doc>   </docgroup> + <docgroup homogen-name='while' homogen-type='method'> + <method name='while'/><doc placeholder='true'> + <text> + <p><tt>while</tt> - execute a statement while an expression is true</p> +  + <tt><p>while( expression ) <i>statement</i><br/> + </p> + </tt> + <p>While runns the statement until the expression is false. The + expression is evaluated once for every loop. If the expression is + false the first time the statement is never executed.</p> +  + control</text> +  + <group><seealso/><text> + <p><ref resolved='predef::for' to='for'>for</ref> and <ref to='do-while'>do-while</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='write' homogen-type='method'>   <method name='write'/><doc placeholder='true'>   <text>
3785:   contain one or more of the following letters:   </p>   <p><matrix> - <r><c> </c><c> 'r' </c><c> : open file for reading </c></r> - <r><c> </c><c> 'w' 'a' 't' 'c' 'x' </c><c> : open file for writing : open file for append (use with 'w') : truncate file at close (use with 'w') : create file if it doesn't exist (use with 'w') : fail if file already exist (use with 'c') </c></r> + <r><c> 'r' </c><c> open file for reading </c></r> + <r><c> 'w' </c><c> open file for writing </c></r> + <r><c> 'a' </c><c> open file for append (use with 'w') </c></r> + <r><c> 't' </c><c> truncate file at close (use with 'w') </c></r> + <r><c> 'c' </c><c> create file if it doesn't exist (use with 'w') </c></r> + <r><c> 'x' </c><c> fail if file already exist (use with 'c') </c></r>   </matrix>      </p>
4029:   </text>      <group><seealso/><text> - <p><ref to='predef::socket'>files/socket</ref> and <ref resolved='predef::/precompiled/port' to='port/accept'>port/accept</ref></p> + <p><ref resolved='predef::/precompiled/file.open_socket' to='file-&gt;open_socket'>file-&gt;open_socket</ref> and <ref resolved='predef::/precompiled/port.accept' to='port-&gt;accept'>port-&gt;accept</ref></p>   </text></group>      </doc>
4084:   <text>   <p><tt>set_nonblocking</tt> - make stream nonblocking</p>    - <tt><p><matrix> - <r><c> void file-&gt;set_nonblocking(function read_callback, </c></r> - <r><c> </c><c> </c><c> function write_callback, function close_callback); </c></r> - </matrix> - </p> + <tt><p>void file-&gt;set_nonblocking(<br/> + <dl><group><text>function read_callback,<br/> + function write_callback,<br/> + function close_callback);<br/> + </text></group></dl></p>   </tt>   <p>This function sets a stream to nonblocking mode. When data arrives on   the stream, read_callback will be called with some or all of this data.
4198:   </text>      <group><seealso/><text> - <p><ref resolved='predef::/precompiled/file' to='file'>file</ref></p> + <p><ref resolved='predef::/precompiled/port.accept' to='/precompiled/file'>/precompiled/file</ref></p>   </text></group>      </doc>
4364:   regexp package written in C. It contains a few simple functions to   handle regexps. A short description of regexp follows:   </p> - <p>. Matches any character<br/> - [abc] Matches a, b or c<br/> - [a-z] Matches any character a to z inclusive<br/> - [^ac] Matches any character except a and c<br/> - (x) Matches x (x might be any regexp)<br/> - x* Matches zero or more occurances of 'x' (x may be anything)<br/> - x|y Matches x or y. (x or y may be any regexp)<br/> - xy Matches xy (x and y may be any regexp)<br/> - ^ Matches beginning of string (but no characters)<br/> - $ Matches end of string (but no characters)<br/> - &lt;x&gt; Used with split() to put the string matching x into the<br/> - <dl><group><text>result array.<br/> - </text></group></dl> + <p><matrix> + <r><c> . </c><c> Matches any character </c></r> + <r><c> [abc] </c><c> Matches a, b or c </c></r> + <r><c> [a-z] </c><c> Matches any character a to z inclusive </c></r> + <r><c> [^ac] </c><c> Matches any character except a and c </c></r> + <r><c> (x) </c><c> Matches x (x might be any regexp) </c></r> + <r><c> x* </c><c> Matches zero or more occurances of 'x' (x may be anything) </c></r> + <r><c> x|y </c><c> Matches x or y. (x or y may be any regexp) </c></r> + <r><c> xy </c><c> Matches xy (x and y may be any regexp) </c></r> + <r><c> ^ </c><c> Matches beginning of string (but no characters) </c></r> + <r><c> $ </c><c> Matches end of string (but no characters) </c></r> + <r><c> &lt;x&gt; </c><c> Used with split() to put the string matching x into the result array. </c></r> + </matrix> +    </p>   <p>Note that \ can be used to quote these characters in which case   they match themselves, nothing else. Also note that when quoting
4386:   <p>For more information about regexps, refer to your unix manuals such   as sed or ed.   </p> - <p>Descriptions of all functions in /precompiled/file follows: + <p>Descriptions of all functions in /precompiled/regexp follows:   </p>   <p/>   </text>