Branch: Tag:

1996-02-10

1996-02-10 21:03:18 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

New documentation files

Rev: doc/lpc/functions:1.1
Rev: doc/lpc/inherit:1.1
Rev: doc/lpc/lambda:1.1
Rev: doc/lpc/variables:1.1

9:   <tt><p>PI<br/>   </p>   </tt> - <p>This is not a function, it is a constant added by simulate.lpc. - </p> - </text> + <p>This is not a function, it is a constant added by simulate.lpc.</p>    -  + float</text> +    </doc>   </docgroup>   <docgroup homogen-name='acos' homogen-type='method'>
92:      <group><example/><text>   <tt><p><matrix> - <r><c> "a"+10 </c><c> </c><c> returns "a10" </c></r> - <r><c> 10+20 </c><c> </c><c> returns 30 </c></r> + <r><c> "a"+10 </c><c> returns "a10" </c></r> + <r><c> 10+20 </c><c> returns 30 </c></r>   <r><c> ({1})+({2}) </c><c> returns ({1,2}) </c></r>   <r><c> (&lt;1&gt;)+(&lt;1&gt;) </c><c> returns (&lt;1,1&gt;) </c></r>   </matrix>
165:      <tt><p>mapping aggregate_mapping(mixed ... <i>elems</i>);<br/>   or<br/> - (&lt; key1:val1, key2:val2, ... &gt;)<br/> + ([ key1:val1, key2:val2, ... ])<br/>   </p>   </tt>   <p>Groups the arguments together two and two to key-index pairs and
258:   <p>Here follows a list of operators that applies to arrays:   In this list a and b is used to represent an array expression:   </p> - <p>a + b : summation ( ({1}) + ({2}) returns ({1,2}) )<br/> - a - b : subtraction, returns a copy of a with all values that are<br/> - <dl><group><text>present in b removed, ( ({1, 2, 3}) - ({2}) returns ({1,3}) )<br/> - </text></group></dl><matrix> - <r><c> a &amp; b : intersection, return an array with all values that are </c></r> - <r><c> </c><c> present in both a and b </c></r> - <r><c> a | b : union, return an array with all values that are present in </c></r> + <p><matrix> + <r><c> a + b </c><c> summation ( ({1}) + ({2}) returns ({1,2}) ) </c></r> + <r><c> a - b </c><c> subtraction, returns a copy of a with all values that are present in b removed, ( ({1, 2, 3}) - ({2}) returns ({1,3}) ) </c></r> + <r><c> a &amp; b </c><c> intersection, return an array with all values that are present in both a and b </c></r> + <r><c> a | b </c><c> union, return an array with all values that are present in a or b, differs from summation in that values that are present in both a and b are only returned once. </c></r> + <r><c> a ^ b </c><c> xor, return an array with all values that are present in a or b but not in both. </c></r> + <r><c> a * c </c><c> multiplication (c is a string) same thing as implode(a,c) </c></r> + <r><c> a == b </c><c> returns 1 if a is the same array as b, same size and values is not enough. </c></r> + <r><c> a != b </c><c> returns 0 if a is the same array as b, same size and values is not enough. </c></r> + <r><c> ! a </c><c> boolean not, returns 0 </c></r> + <r><c> a[c] </c><c> indexing, returns element c in the array (c is an int) </c></r> + <r><c> a[c]=d </c><c> setting, sets element c in the array to d (c is an int) </c></r> + <r><c> a[c..d] </c><c> range (c &amp; d are ints) returns an array containing a pice of the array a. The piece starts at element c and ends (and includes) element d. </c></r>   </matrix> - <dl><group><text>a or b, differs from summation in that values that are<br/> - present in both a and b are only returned once.<br/> - </text></group></dl>a ^ b : xor, return an array with all values that are present in<br/> - <dl><group><text>a or b but not in both.<br/> - </text></group></dl>a * c : multiplication (c is a string) same thing as implode(a,c)<br/> - a == b : returns 1 if a is the same array as b, same size and values<br/> - <dl><group><text>is not enough.<br/> - </text></group></dl>a != b : returns 0 if a is the same array as b, same size and values<br/> - <dl><group><text>is not enough.<br/> - </text></group></dl>! a : boolean not, returns 0<br/> - a[c] : indexing, returns element c in the array (c is an int)<br/> - a[c]=d : setting, sets element c in the array to d (c is an int)<br/> - a[c..d]: range (c &amp; d are ints) returns an array containing a pice of<br/> - <dl><group><text>the array a. The piece starts at element c and ends (and<br/> - includes) element d.<br/> - </text></group></dl></p> - </text> + </p>    -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::mapping' to='mapping'>mapping</ref>, <ref resolved='predef::list' to='list'>list</ref>, <ref resolved='predef::allocate' to='predef::allocate'>builtin/allocate</ref>, <ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref> and <ref resolved='predef::values' to='predef::values'>builtin/values</ref></p>   </text></group>
303:   array</text>      <group><seealso/><text> - <p><ref resolved='predef::allocate' to='allocate'>allocate</ref>, <ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::allocate' to='allocate'>allocate</ref>, <ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
355:   in the stack. Each entry has this format:   </p>   <p>({<br/> - <dl><group><text>file, /* a string with the filename if known, else zero */<br/> - function, /* The function-pointer to the called function */<br/> - line, /* an integer containing the line if known, else zero */<br/> + <dl><group><text><matrix> + <r><c> file, </c><c> /* a string with the filename if known, else zero */ </c></r> + <r><c> function, </c><c> /* The function-pointer to the called function */ </c></r> + <r><c> line, </c><c> /* an integer containing the line if known, else zero */ </c></r> + </matrix>   </text></group></dl>})<br/>      </p>
385:   this function with the rest of the arguments as arguments. Normally,   you will never have to write call_function(), because you will use the   second syntax instead.</p> - </text> +     -  + function</text> +    <group><seealso/><text>   <p><ref resolved='predef::backtrace' to='backtrace'>backtrace</ref> and <ref resolved='predef::get_function' to='get_function'>get_function</ref></p>   </text></group>
424:   contains an array that looks like this:   </p>   <p>({<br/> - <dl><group><text>time_left, /* an int */<br/> - caller, /* the object that made the call out */<br/> - function, /* the function to be called */<br/> - arg1, /* the first argument, if any */<br/> - arg2, /* the second argument, if any */<br/> - ... /* and so on... */<br/> + <dl><group><text><matrix> + <r><c> time_left, </c><c> /* an int */ </c></r> + <r><c> caller, </c><c> /* the object that made the call out */ </c></r> + <r><c> function, </c><c> /* the function to be called */ </c></r> + <r><c> arg1, </c><c> /* the first argument, if any */ </c></r> + <r><c> arg2, </c><c> /* the second argument, if any */ </c></r> + <r><c> ... </c><c> /* and so on... */ </c></r> + </matrix>   </text></group></dl>})<br/>   </p>   </text>
450:   </tt>   <p>Convert the first character in str to upper case, and return the   new string.</p> - </text> +     -  + string</text> +    <group><seealso/><text>   <p><ref resolved='predef::lower_case' to='predef::lower_case'>builtin/lower_case</ref> and <ref resolved='predef::upper_case' to='predef::upper_case'>builtin/upper_case</ref></p>   </text></group>
591:   &gt; combine_path("/foo/bar","./sune.c");<br/>   Result: /foo/bar/sune.c<br/>   </p> - </tt></text></group> + </tt> + file</text></group>      <group><seealso/><text>   <p><ref resolved='predef::getcwd' to='getcwd'>getcwd</ref></p>
696:   </text>      <group><example/><text> - <tt><p><matrix> - <r><c> To crypt a password use: </c></r> - <r><c> </c><c> crypted_password = crypt(typed_password); </c></r> - <r><c> To see if the same password was used again use: </c></r> - <r><c> </c><c> matched = crypt(typed_password, crypted_password); </c></r> - </matrix> + <tt><p>To crypt a password use:<br/> + <dl><group><text>crypted_password = crypt(typed_password);<br/> + </text></group></dl>To see if the same password was used again use:<br/> + <dl><group><text>matched = crypt(typed_password, crypted_password);<br/> + </text></group></dl></p> + </tt> + string</text></group>    - </p> - <p><matrix> - <r><c> </c><c> </c></r> - <r><c> </c></r> - </matrix> - </p> - </tt></text></group> -  +    </doc>   </docgroup>   <docgroup homogen-name='ctime' homogen-type='method'>
947:   <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> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::write_file' to='write_file'>write_file</ref> and <ref resolved='predef::read_bytes' to='read_bytes'>read_bytes</ref></p>   </text></group>
1020:   <p>Third syntax:   Filter array calls all functionpointers in the array arr, and   return all that returned true.</p> - </text> +     -  + array</text> +    <group><seealso/><text>   <p><ref resolved='predef::sum_arrays' to='sum_arrays'>sum_arrays</ref> and <ref resolved='predef::map_array' to='map_array'>map_array</ref></p>   </text></group>
1063:   <p>A list of operators that applies to floats follows:   In this list a and b is used to represent a float expression:   </p> - <p>a + b : summation - a - b : subtraction - a * b : multiplication - a / b : integer division - a % b : modulo ( same thing as a - floor( a / b ) * b ) - - a : negation - a == b : return 1 if a is equal to b, 0 otherwise - a != b : return 0 if a is equal to b, 1 otherwise - a &lt; b : returns 1 if a is lesser than b, 0 otherwise - a &lt;= b : returns 1 if a is lesser or equal to b, 0 otherwise - a &gt; b : returns 1 if a is greater than b, 0 otherwise - a &gt;= b : returns 1 if a is greater or equal to b, 0 otherwise</p> + <p><matrix> + <r><c> a + b </c><c> summation </c></r> + <r><c> a - b </c><c> subtraction </c></r> + <r><c> a * b </c><c> multiplication </c></r> + <r><c> a / b </c><c> integer division </c></r> + <r><c> a % b </c><c> modulo ( same thing as a - floor( a / b ) * b ) </c></r> + <r><c> - a </c><c> negation </c></r> + <r><c> a == b </c><c> return 1 if a is equal to b, 0 otherwise </c></r> + <r><c> a != b </c><c> return 0 if a is equal to b, 1 otherwise </c></r> + <r><c> a &lt; b </c><c> returns 1 if a is lesser than b, 0 otherwise </c></r> + <r><c> a &lt;= b </c><c> returns 1 if a is lesser or equal to b, 0 otherwise </c></r> + <r><c> a &gt; b </c><c> returns 1 if a is greater than b, 0 otherwise </c></r> + <r><c> a &gt;= b </c><c> returns 1 if a is greater or equal to b, 0 otherwise </c></r> + </matrix> + </p>   </text>      <group><note/><text>   <p>floats and ints cannot be used together, they have to be cast   to the same type first.</p> - </text></group> +     -  + type</text></group> +    <group><seealso/><text> - <p><ref resolved='predef::float' to='float'>float</ref> and <ref resolved='predef::' to='predef::'>modules/math</ref></p> + <p><ref resolved='predef::sin' to='predef::sin'>math/sin</ref>, <ref resolved='predef::cos' to='predef::cos'>math/cos</ref>, <ref resolved='predef::tan' to='predef::tan'>math/tan</ref> and <ref resolved='predef::sqrt' to='predef::sqrt'>math/sqrt</ref></p>   </text></group>      </doc>
1101:   float</text>      <group><seealso/><text> - <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
1161:   If the object the functionpointer is in is destructed the pointer will   become 0. If you try to call a functionpointer that has is 0 then 0   will be returned.</p> - </text> +     -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::object' to='object'>object</ref>, <ref resolved='predef::call_function' to='predef::call_function'>builtin/call_function</ref>, <ref resolved='predef::functionp' to='predef::functionp'>builtin/functionp</ref>, <ref resolved='predef::function_object' to='predef::function_object'>builtin/function_object</ref> and <ref resolved='predef::function_name' to='predef::function_name'>builtin/function_name</ref></p>   </text></group>
1221:   function</text>      <group><seealso/><text> - <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::floatp' to='floatp'>floatp</ref></p> + <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::floatp' to='floatp'>floatp</ref></p>   </text></group>      </doc>   </docgroup> -  + <docgroup homogen-name='functions' homogen-type='method'> + <method name='functions'/><doc placeholder='true'> + <text> + <p><tt>functions</tt> - how to write a function</p> +  + <tt><p>modifier type function_name (argument_specification)<br/> + {<br/> + <dl><group><text>/* function body */<br/> + </text></group></dl>}<br/> + </p> + </tt> + <p>This defines a function called 'function_name' returning the type + 'type'. The argument_specification is a comma separated list of + arguments. Each argument is specified with a type, whitespace and + the name of the argument. The last argument may have ... before + the name to indicate that that argument shall contain an array of + the rest of the arguments given by the caller. Note that using + ... automatically makes an the variable an array, so writing + </p> + <p><matrix> + <r><c> </c><c> int foo(int * ... ints); </c></r> + <r><c> </c></r> + </matrix> +  + </p> + <p>means that 'ints' is an array of arrays of integers. Which might not + be what you want. + </p> + <p>The modifiers can be zero or more of: static, no_mask, varargs, inline + and private. Varargs means that it is ok to call the function with + less arguments that would otherwise be needed. Inline means that + the function may be inlined in other code. Inline also makes the + function no_mask. Static means that the function can not be called + from other objects. Private means that the function can not be accessed + from programs that inherits this program. + </p> + <p>Some times you need to use a function before it is defined, then you + can write a 'forward declaration' of the function. This is done by + copying the function definition up until (but not including) the '{' + and putting a semicolon after it. The forward declaration should be + put before the use of the function of course. + </p> + <p>Function definitions and forward declarations are toplevel constructs, + they can not be written inside functions or expressions.</p> + </text> +  + <group><example/><text> + <tt><p>/* Forward declare foobar as taking an array of int as argument <br/> + <dl><group><text>*and returning an int<br/> + */<br/> + </text></group></dl>static int foobar(int *a);<br/> +  + </p> + <p>/* This function takes a format string and any number of integers<br/> + <dl><group><text>* as argument and returns a string<br/> + */<br/> + </text></group></dl>string dofobar(string format ,int ... rest)<br/> + {<br/> + <dl><group><text>return sprintf(format, foobar(rest));<br/> + </text></group></dl>}<br/> +  + </p> + <p>/* Define foobar */<br/> + static int foobar(int *a)<br/> + {<br/> + <dl><group><text>int e, ret;<br/> + ret=1;<br/> + </text></group></dl> + </p> + <p><dl><group><text>for(e=0;e&lt;sizeof(a);e++)<br/> + <dl><group><text>ret*=a[e];<br/> + </text></group></dl></text></group></dl> + </p> + <p><dl><group><text>return ret;<br/> + </text></group></dl>}<br/> + </p> + </tt> + 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> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='get_dir' homogen-type='method'>   <method name='get_dir'/><doc placeholder='true'>   <text>
1252:   <tt><p>function get_function(object <i>o</i>, string <i>name</i>);<br/>   </p>   </tt> - <p>Defined as: return o[name]; - </p> - </text> + <p>Defined as: return o[name];</p>    -  + function</text> +    </doc>   </docgroup>   <docgroup homogen-name='getcwd' homogen-type='method'>
1453:      </doc>   </docgroup> + <docgroup homogen-name='inherit' homogen-type='method'> + <method name='inherit'/><doc placeholder='true'> + <text> + <p><tt>inherit</tt> - use definitions from another program</p> +  + <tt><p>inherit "&lt;program name&gt;";<br/> + or<br/> + inherit "&lt;program name&gt;" : local_name;<br/> + </p> + </tt> + <p><matrix> + <r><c> Inherit copies the global identifiers (functions and global variables) </c></r> + <r><c> from the named program. These functions and variables can then be </c></r> + <r><c> used as </c><c> if they were defined in this program. All the inherited </c></r> + <r><c> identifiers that was no declared as no_mask in the inherited program </c></r> + <r><c> can be also be redefined. The redefinition will not only </c></r> + <r><c> affect functions following the redefinition, but all functions in </c></r> + <r><c> this program, including the inherited ones. </c></r> + </matrix> +  + </p> + <p>Even if an identifier is redefined you can still access the original + though. Prepending the identifier name with :: will return the original + identifier, OR an array of all inherited identifiers with that name. + </p> + <p>You can also use the local_name to access a specific identifier, just + prepend it like 'local_name::identifier'. This will return the named + identifer in the program inherited with the given local_name. If no + local_name was given to inherit , the last part of the path in the + program name will be used as local_name. + </p> + <p>Inherit calls master()-&gt;cast_to_program(&lt;program name&gt;) to get the + program to inherit. For this reason there can be no inherits in the + master object. + </p> + <p>Inherit is not an expression or statement, it is a toplevel construct + and must not be written inside a function body.</p> + </text> +  + <group><example/><text> + <tt><p>/* This is file hworld.lpc */<br/> + int hello_world() { write("Hello world.\n"); }<br/> +  + </p> + <p>/* This is the file hello_world.lpc */<br/> + inherit "hworld.lpc";<br/> + <br/> + int main()<br/> + {<br/> + <dl><group><text>hello_world();<br/> + exit(0);<br/> + </text></group></dl>}<br/> + </p> + </tt> + lpc</text></group> +  + <group><seealso/><text> + <p><ref to='class'>class</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='int' homogen-type='method'>   <method name='int'/><doc placeholder='true'>   <text>
1470:   </p>   <p>In this list a and b is used to represent an integer expression:   </p> - <p>a + b : summation - a - b : subtraction - a * b : multiplication - a / b : integer division - a % b : modulo ( same thing as a - ( a / b ) * b ) - a | b : bitwise or - a &amp; b : bitwise and - a ^ b : bitwise xor - ! a : boolean not, returns 1 if a is zero 0 otherwise - ~ a : bitwise complement - - a : negation - a == b : return 1 if a is equal to b, 0 otherwise - a != b : return 0 if a is equal to b, 1 otherwise - a &lt; b : returns 1 if a is lesser than b, 0 otherwise - a &lt;= b : returns 1 if a is lesser or equal to b, 0 otherwise - a &gt; b : returns 1 if a is greater than b, 0 otherwise - a &gt;= b : returns 1 if a is greater or equal to b, 0 otherwise</p> - </text> + <p><matrix> + <r><c> a + b </c><c> summation </c></r> + <r><c> a - b </c><c> subtraction </c></r> + <r><c> a * b </c><c> multiplication </c></r> + <r><c> a / b </c><c> integer division </c></r> + <r><c> a % b </c><c> modulo ( same thing as a - ( a / b ) * b ) </c></r> + <r><c> a | b </c><c> bitwise or </c></r> + <r><c> a &amp; b </c><c> bitwise and </c></r> + <r><c> a ^ b </c><c> bitwise xor </c></r> + <r><c> ! a </c><c> boolean not, returns 1 if a is zero 0 otherwise </c></r> + <r><c> ~ a </c><c> bitwise complement </c></r> + <r><c> - a </c><c> negation </c></r> + <r><c> a == b </c><c> return 1 if a is equal to b, 0 otherwise </c></r> + <r><c> a != b </c><c> return 0 if a is equal to b, 1 otherwise </c></r> + <r><c> a &lt; b </c><c> returns 1 if a is lesser than b, 0 otherwise </c></r> + <r><c> a &lt;= b </c><c> returns 1 if a is lesser or equal to b, 0 otherwise </c></r> + <r><c> a &gt; b </c><c> returns 1 if a is greater than b, 0 otherwise </c></r> + <r><c> a &gt;= b </c><c> returns 1 if a is greater or equal to b, 0 otherwise </c></r> + </matrix> + </p>    -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::float' to='float'>float</ref></p>   </text></group>
1508:   int</text>      <group><seealso/><text> - <p><ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
1527:   <p>Some signals and their supposed purpose:   </p>   <p><matrix> - <r><c> SIGHUP </c><c> Hangup, sent to process when user logs out </c></r> - <r><c> SIGINT </c><c> Interrupt, normally sent by ctrl-c </c></r> - <r><c> SIGQUIT </c><c> Quit, sent by ctrl-\ </c></r> - <r><c> SIGILL </c><c> Illegal instruction </c></r> - <r><c> SIGTRAP </c><c> Trap, mostly used by debuggers </c></r> - <r><c> SIGABRT </c><c> Aborts process, can be caught, used by uLPC whenever something goes seriously wrong. </c></r> - <r><c> SIGBUS </c><c> Bus error </c></r> - <r><c> SIGFPE </c><c> Floating point error (such as division by zero) </c></r> - <r><c> SIGKILL </c><c> Really kill a process, cannot be caught </c></r> - <r><c> SIGUSR1 </c><c> Signal reserved for whatever you want to use it for. </c></r> - <r><c> SIGSEGV </c><c> Segmentation fault, caused by accessing memory where you shouldn't. Should never happen to uLPC. </c></r> - <r><c> SIGUSR2 </c><c> Signal reserved for whatever you want to use it for. </c></r> - <r><c> SIGALRM </c><c> Signal used for timer interrupts. </c></r> - <r><c> SIGTERM </c><c> Termination signal </c></r> - <r><c> SIGSTKFLT Stack fault </c></r> - <r><c> SIGCHLD </c><c> Child process died </c></r> - <r><c> SIGCONT </c><c> Continue suspended </c></r> - <r><c> SIGSTOP </c><c> Stop process </c></r> - <r><c> SIGSTP </c><c> Suspend process </c></r> - <r><c> SIGTTIN </c><c> tty input for background process </c></r> - <r><c> SIGTTOU </c><c> tty output for background process </c></r> - <r><c> SIGXCPU </c><c> Out of cpu </c></r> - <r><c> SIGXFSZ </c><c> File size limit exceeded </c></r> - <r><c> SIGPROF </c><c> Profile trap </c></r> - <r><c> SIGWINCH Window change signal </c></r> - <r><c> Note that you have to use signame to translate the name of a signal </c></r> - <r><c> to it's number. </c></r> + <r><c> SIGHUP </c><c> Hangup, sent to process when user logs out </c></r> + <r><c> SIGINT </c><c> Interrupt, normally sent by ctrl-c </c></r> + <r><c> SIGQUIT </c><c> Quit, sent by ctrl-\ </c></r> + <r><c> SIGILL </c><c> Illegal instruction </c></r> + <r><c> SIGTRAP </c><c> Trap, mostly used by debuggers </c></r> + <r><c> SIGABRT </c><c> Aborts process, can be caught, used by uLPC whenever something goes seriously wrong. </c></r> + <r><c> SIGBUS </c><c> Bus error </c></r> + <r><c> SIGFPE </c><c> Floating point error (such as division by zero) </c></r> + <r><c> SIGKILL </c><c> Really kill a process, cannot be caught </c></r> + <r><c> SIGUSR1 </c><c> Signal reserved for whatever you want to use it for. </c></r> + <r><c> SIGSEGV </c><c> Segmentation fault, caused by accessing memory where you shouldn't. Should never happen to uLPC. </c></r> + <r><c> SIGUSR2 </c><c> Signal reserved for whatever you want to use it for. </c></r> + <r><c> SIGALRM </c><c> Signal used for timer interrupts. </c></r> + <r><c> SIGTERM </c><c> Termination signal </c></r> + <r><c> SIGSTKFLT </c><c> Stack fault </c></r> + <r><c> SIGCHLD </c><c> Child process died </c></r> + <r><c> SIGCONT </c><c> Continue suspended </c></r> + <r><c> SIGSTOP </c><c> Stop process </c></r> + <r><c> SIGSTP </c><c> Suspend process </c></r> + <r><c> SIGTTIN </c><c> tty input for background process </c></r> + <r><c> SIGTTOU </c><c> tty output for background process </c></r> + <r><c> SIGXCPU </c><c> Out of cpu </c></r> + <r><c> SIGXFSZ </c><c> File size limit exceeded </c></r> + <r><c> SIGPROF </c><c> Profile trap </c></r> + <r><c> SIGWINCH </c><c> Window change signal </c></r>   </matrix> -  +    </p> -  + <p>Note that you have to use signame to translate the name of a signal + to it's number.</p>   </text>      <group><seealso/><text>
1573:   </p>   </tt>   <p>This function is equal to builtin/sizeof.</p> - </text> +     -  + list</text> +    <group><seealso/><text>   <p><ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p>   </text></group>      </doc>   </docgroup> -  + <docgroup homogen-name='lambda' homogen-type='method'> + <method name='lambda'/><doc placeholder='true'> + <text> + <p><tt>lambda</tt> - write nameless functions</p> +  + <tt><p>lambda(&lt;argument specifications&gt;) { <i>code</i> }<br/> + </p> + </tt> + <p>Lambda let's you write a function as a value to a function call + or anywhere where you can enter an expression. Using lambda is + basically the same as defining the function before the current + function with a temporary name and then use the name instead.</p> + </text> +  + <group><example/><text> + <tt><p>/* These two lettersort routines are equal */<br/> + string *lettersort(string *words)<br/> + {<br/> + <dl><group><text>return sort_array(lettersort, lambda(string a,string b)<br/> + <dl><group><text>{<br/> + <dl><group><text>return a &lt; b;<br/> + </text></group></dl>});<br/> + </text></group></dl></text></group></dl>}<br/> +  + </p> + <p>int tmp_cmp_fun(string a, string b)<br/> + {<br/> + <dl><group><text>return a &lt; b;<br/> + </text></group></dl>}<br/> +  + </p> + <p>string *lettersort(string *words)<br/> + {<br/> + <dl><group><text>return sort_array(lettersort, tmp_cmp_fun);<br/> + </text></group></dl>}<br/> + </p> + </tt></text></group> +  + <group><note/><text> + <p>function_name() will return something for lambda functions, + what it returns is unspecified though.</p> + </text></group> +  + <group><bugs/><text> + <p>confuses the hell out of C indent programs</p> +  + lpc</text></group> +  + <group><seealso/><text> + <p><ref to='class'>class</ref> and <ref resolved='predef::function' to='function'>function</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='list' homogen-type='method'>   <method name='list'/><doc placeholder='true'>   <text>
1595:   <p>Here follows a list of operators that applies to lists:   In this list a and b is used to represent a list expression:   </p> - <p>a + b : summation ( (&lt;1&gt;) + (&lt;2&gt;) returns (&lt;1,2&gt;) )<br/> - a - b : subtraction, returns a copy of a with all values that are<br/> - <dl><group><text>present in b removed.<br/> - a &amp; b : intersection, return a list with all values that are<br/> - present in both a &amp; b.<br/> - a | b : union, return a list with all values that are present in<br/> - a or b, differs from summation in that values that are<br/> - present in both a and b are only returned once.<br/> - a ^ b : xor, return a list with all indices that are present in<br/> - a or b but not in both.<br/> - a == b : returns 1 if a is the same list as b, same size and values<br/> - is not enough.<br/> - a != b : returns 1 if a is the same list as b, same size and values<br/> - is not enough.<br/> - ! a : boolean not, returns 0<br/> - </text></group></dl><matrix> - <r><c> a[c] : indexing, returns 1 c is present in the list a. </c></r> - <r><c> a[c]=d : setting, if d is true, c is added to the list if it is not </c></r> - <r><c> </c><c> present already. If d is false, it is removed if it is </c></r> + <p><matrix> + <r><c> a + b </c><c> summation ( (&lt;1&gt;) + (&lt;2&gt;) returns (&lt;1,2&gt;) ) </c></r> + <r><c> a - b </c><c> subtraction, returns a copy of a with all values that are present in b removed. </c></r> + <r><c> a &amp; b </c><c> intersection, return a list with all values that are present in both a &amp; b. </c></r> + <r><c> a | b </c><c> union, return a list with all values that are present in a or b, differs from summation in that values that are present in both a and b are only returned once. </c></r> + <r><c> a ^ b </c><c> xor, return a list with all indices that are present in a or b but not in both. </c></r> + <r><c> a == b </c><c> returns 1 if a is the same list as b, same size and values is not enough. </c></r> + <r><c> a != b </c><c> returns 1 if a is the same list as b, same size and values is not enough. </c></r> + <r><c> ! a </c><c> boolean not, returns 0 </c></r> + <r><c> a[c] </c><c> indexing, returns 1 c is present in the list a. </c></r> + <r><c> a[c]=d </c><c> setting, if d is true, c is added to the list if it is not present already. If d is false, it is removed if it is present. </c></r>   </matrix> - <dl><group><text>present.<br/> - </text></group></dl></p> - </text> + </p>    -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::mapping' to='mapping'>mapping</ref>, <ref resolved='predef::array' to='array'>array</ref>, <ref resolved='predef::indices' to='predef::indices'>builtin/indices</ref> and <ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p>   </text></group>
1638:   list</text>      <group><seealso/><text> - <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
1710:   </p>   </tt>   <p>This function is equal to builtin/indices</p> - </text> +     -  + mapping</text> +    <group><seealso/><text>   <p><ref resolved='predef::indices' to='predef::indices'>builtin/indices</ref></p>   </text></group>
1727:   </p>   </tt>   <p>This function is equal to builtin/sizeof.</p> - </text> +     -  + mapping</text> +    <group><seealso/><text>   <p><ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p>   </text></group>
1744:   </p>   </tt>   <p>This function is equal to builtin/values</p> - </text> +     -  + mapping</text> +    <group><seealso/><text>   <p><ref resolved='predef::values' to='predef::values'>builtin/values</ref></p>   </text></group>
1775:   <p>Third syntax:   Map array calls the functions in the array arr:   arr[x]=arr[x]-&gt;fun(@ args);</p> - </text> +     -  + array</text> +    <group><seealso/><text>   <p><ref resolved='predef::sum_arrays' to='sum_arrays'>sum_arrays</ref> and <ref resolved='predef::filter_array' to='filter_array'>filter_array</ref></p>   </text></group>
1802:   <p>Here follows a list of operators that applies to mappings:   In this list a and b is used to represent a mapping expression:   </p> - <p>a + b : summation ( ([1:1]) + ([2:2,2:2]) returns ([1:1,2:2]) )<br/> - a - b : subtraction, returns a copy of a with all pairs whos<br/> - <dl><group><text>index is present in b removed.<br/> - a &amp; b : intersection, return a mapping with all indices that are<br/> - </text></group></dl><matrix> - <r><c> </c><c> present in both a and b, if an index is present in both </c></r> - <r><c> </c></r> + <p><matrix> + <r><c> a + b </c><c> summation ( ([1:1]) + ([2:2,2:2]) returns ([1:1,2:2]) ) </c></r> + <r><c> a - b </c><c> subtraction, returns a copy of a with all pairs whos index is present in b removed. </c></r> + <r><c> a &amp; b </c><c> intersection, return a mapping with all indices that are resent in both a and b, if an index is present in both a &amp; b the data for that index will be taken from b. </c></r> + <r><c> a | b </c><c> union, return a mapping with all values that are present in a or b, differs from summation in that values that are present in both a and b are only returned once, as with intersection, data will be taken from b when possible. </c></r> + <r><c> a ^ b </c><c> xor, return a mapping with all indices that are present in a or b but not in both. </c></r> + <r><c> a == b </c><c> returns 1 if a is the same mapping as b, same size, indices and values is not enough, 0 otherwise. </c></r> + <r><c> a != b </c><c> returns 0 if a is the same mapping as b, same size, indices and values is not enough, 1 otherwise. </c></r> + <r><c> ! a </c><c> boolean not, returns 0 </c></r> + <r><c> a[c] </c><c> indexing, returns the value associated with the value c in the mapping a. If there is no index c in the mapping zero will be returned. (With zero type = 1) </c></r> + <r><c> a[c]=d </c><c> setting, this associates d with c in the mapping, the index c will be added to the mapping automatically if it isn't already there. </c></r>   </matrix> - <dl><group><text>a &amp; b the data for that index will be taken from b.<br/> - a | b : union, return a mapping with all values that are present in<br/> - a or b, differs from summation in that values that are<br/> - present in both a and b are only returned once, as with<br/> - intersection, data will be taken from b when possible.<br/> - a ^ b : xor, return a mapping with all indices that are present in<br/> - a or b but not in both.<br/> - a == b : returns 1 if a is the same mapping as b, same size, indices<br/> - and values is not enough, 0 otherwise.<br/> - a != b : returns 0 if a is the same mapping as b, same size, indices<br/> - and values is not enough, 1 otherwise.<br/> - ! a : boolean not, returns 0<br/> - </text></group></dl>a[c] : indexing, returns the value associated with the value c<br/> - <dl><group><text>in the mapping a. If there is no index c in the mapping<br/> - zero will be returned. (With zero type = 1)<br/> - </text></group></dl>a[c]=d : setting, this associates d with c in the mapping, the index<br/> - <dl><group><text>c will be added to the mapping automatically if it isn't<br/> - already there.<br/> - </text></group></dl></p> - </text> + </p>    -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::array' to='array'>array</ref>, <ref resolved='predef::list' to='list'>list</ref>, <ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref>, <ref resolved='predef::indices' to='predef::indices'>builtin/indices</ref> and <ref resolved='predef::values' to='predef::values'>builtin/values</ref></p>   </text></group>
1850:   mapping</text>      <group><seealso/><text> - <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
1863:   <tt><p>object master();<br/>   </p>   </tt> - <p>Master is added by the master object to make it easier to access it. - </p> - </text> + <p>Master is added by the master object to make it easier to access it.</p>    -  + object</text> +    </doc>   </docgroup>   <docgroup homogen-name='member_array' homogen-type='method'>
1878:   </p>   </tt>   <p>Returns the index of the first occurence of item in array arr. - If not found, then -1 is returned. - </p> - </text> + If not found, then -1 is returned.</p>    -  + array</text> +    </doc>   </docgroup>   <docgroup homogen-name='mkdir' homogen-type='method'>
1920:   3<br/>   </text></group></dl>&gt;)<br/>   </p> - </tt></text></group> + </tt> + list</text></group>      <group><seealso/><text>   <p><ref resolved='predef::aggregate_list' to='predef::aggregate_list'>builtin/aggregate_list</ref></p>
2010:   In this list, o and o2 are used to represent object expressions,   and s is a string expression:   </p> - <p>o[s] : indexing, returns the identifier named s in the object o,<br/> - <dl><group><text>an identifier is a global variable or a function.<br/> - </text></group></dl><matrix> - <r><c> o[s]=c : This sets the global variable s int the object o to c, </c></r> - <r><c> </c><c> if s is a function however, an error is produced. </c></r> - <r><c> o -&gt; foo : same as o["foo"] </c></r> - <r><c> o == o2 : return 1 if o and o2 are the same object </c></r> - <r><c> o != o2 : return 0 if o and o2 are the same object </c></r> + <p><matrix> + <r><c> o[s] </c><c> indexing, returns the identifier named s in the object o, </c></r> + <r><c> </c><c> an identifier is a global variable or a function. </c></r> + <r><c> o[s]=c </c><c> This sets the global variable s int the object o to c, if s is a function however, an error is produced. </c></r> + <r><c> o-&gt;foo </c><c> same as o["foo"] </c></r> + <r><c> o == o2 </c><c> return 1 if o and o2 are the same object </c></r> + <r><c> o != o2 </c><c> return 0 if o and o2 are the same object </c></r>   </matrix>   </p> - </text> +     -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::program' to='program'>program</ref>, <ref resolved='predef::function' to='function'>function</ref>, <ref resolved='predef::clone' to='predef::clone'>builtin/clone</ref> and <ref resolved='predef::destruct' to='predef::destruct'>builtin/destruct</ref></p>   </text></group>
2059:   object</text>      <group><seealso/><text> - <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
2142:   compile_file() or compile_string(). Programs are only useful as   arguments to clone() and the only operators that applies to programs   are == and !=.</p> - </text> +     -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::object' to='object'>object</ref>, <ref resolved='predef::function' to='function'>function</ref>, <ref resolved='predef::compile_file' to='predef::compile_file'>builtin/compile_file</ref>, <ref resolved='predef::compile_string' to='predef::compile_string'>builtin/compile_string</ref> and <ref resolved='predef::clone' to='predef::clone'>builtin/clone</ref></p>   </text></group>
2163:   program</text>      <group><seealso/><text> - <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::stringp' to='stringp'>stringp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
2270:   </tt>   <p>Read len number of bytes from file file staring at byte start and   return it as a string.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref resolved='predef::write_file' to='write_file'>write_file</ref></p>   </text></group>
2287:   </p>   </tt>   <p>Return those strings in arr that matches the regexp in reg.</p> - </text> +     -  + string</text> +    <group><seealso/><text>   <p><ref resolved='predef::regexp' to='regexp/regexp'>regexp/regexp</ref></p>   </text></group>
2332:   <p>This function can do several kinds replacement operations, the   different syntaxes do different things as follow:   </p> - <p>1) string replace(string s, string from, string to);<br/> - <dl><group><text>When given strings as second and third argument, a copy of<br/> + <p>string replace(string s, string from, string to); + </p> + <p><dl><group><text>When given strings as second and third argument, a copy of<br/>   s with every occurance of 'from' return 'to'.<br/>   </text></group></dl>   </p> - <p>2) string replace(string s, string *from, string *to);<br/> - <dl><group><text>When given arrays of strings as second and third argument,<br/> + <p>string replace(string s, string *from, string *to); + </p> + <p><dl><group><text>When given arrays of strings as second and third argument,<br/>   every occurance of from[0] in s is replaced by to[0],<br/>   from[1] is replaced by to[1] and so on...<br/>   </text></group></dl>   </p> - <p>3) array replace(array a, mixed from, mixed to);<br/> - 4) mapping replace(mapping a, mixed from, mixed to);<br/> - <dl><group><text>When the first argument is an array or mapping, the values in<br/> + <p><matrix> + <r><c> array replace(array a, mixed from, mixed to); </c><c> </c></r> + <r><c> mapping replace(mapping a, mixed from, mixed to); </c></r> + </matrix> +  + </p> + <p><dl><group><text>When the first argument is an array or mapping, the values in<br/>   a are searched for values equal to from, which are replaced by<br/>   to destructively.<br/>   </text></group></dl></p>
2500:   <p>search_array works like map_array, only it returns the index of the   first call that returned true instead or returning an array of the   returned values. If no call returns true, -1 is returned.</p> - </text> +     -  + array</text> +    <group><seealso/><text>   <p><ref resolved='predef::sum_arrays' to='sum_arrays'>sum_arrays</ref>, <ref resolved='predef::filter_array' to='filter_array'>filter_array</ref> and <ref resolved='predef::member_array' to='member_array'>member_array</ref></p>   </text></group>
2648:   is larger then the second. The rest of the arguments 'args' will be   sent as 3rd, 4th etc. argument to fun. If fun is omitted, &lt; is unsed   instead.</p> - </text> +     -  + array</text> +    <group><seealso/><text>   <p><ref resolved='predef::map_array' to='map_array'>map_array</ref> and <ref resolved='predef::filter_array' to='filter_array'>filter_array</ref></p>   </text></group>
2677:   </text>      <group><seealso/><text> - <p><ref resolved='predef::popen' to='popen'>popen</ref>, <ref resolved='predef::fork' to='predef::fork'>files/fork</ref>, <ref resolved='predef::exec' to='predef::exec'>files/exec</ref>, <ref to='predef::files-&gt;pipe'>files/files-&gt;pipe</ref> and <ref to='predef::files-&gt;dup2'>files/files-&gt;dup2</ref></p> + <p><ref resolved='predef::popen' to='popen'>popen</ref>, <ref resolved='predef::fork' to='predef::fork'>files/fork</ref>, <ref resolved='predef::exec' to='predef::exec'>files/exec</ref>, <ref resolved='predef::/precompiled/file.pipe' to='predef::file-&gt;pipe'>files/file-&gt;pipe</ref> and <ref resolved='predef::/precompiled/file.dup2' to='predef::file-&gt;dup2'>files/file-&gt;dup2</ref></p>   </text></group>      </doc>
2900:   separated by "%d,%s,%c and %f. Every % corresponds to one of var1,   var2...   </p> - <p>%d gives an integer<br/> - %f gives a float<br/> - %c matches one char but returns an integer<br/> - %s gives a string<br/> - %[set] matches a string containing a given set of characters.<br/> - <dl><group><text>(thos given inside the brackets) %[^set] means any character<br/> - ecept those inside brackets. %[0-9H] means any number or 'H'.<br/> - </text></group></dl> + <p><matrix> + <r><c> %d </c><c> gives an integer </c></r> + <r><c> %o </c><c> gives an octal integer </c></r> + <r><c> %x </c><c> gives a hexadecimal integer </c></r> + <r><c> %D </c><c> gives an integer that is either octal (leading zero), hexadecimal (leading 0x) or decimal. </c></r> + <r><c> %f </c><c> gives a float </c></r> + <r><c> %c </c><c> matches one char and returns it as an integer </c></r> + <r><c> %s </c><c> gives a string </c></r> + <r><c> %[set] </c><c> matches a string containing a given set of characters. (thos given inside the brackets) %[^set] means any character ecept those inside brackets. %[0-9H] means any number or 'H'. </c></r> + </matrix> +    </p>   <p>If a * is put between the percent and the operator, the operator   will not only match it's argument, not assign any variables.
2942:   <p>A list of operators that applies to strings follow:   In this list a and b is used to represent a string expression:   </p> - <p>a + b : summation ( "a"+"b" returns "ab") - a - b : subtraction ( same as replace(a,b,"") ) - a / b : division ( same thing as explode(a,b) ) - ! a : boolean not, returns 0 + <p><matrix> + <r><c> a + b </c><c> summation ( "a"+"b" returns "ab") </c></r> + <r><c> a - b </c><c> subtraction ( same as replace(a,b,"") ) </c></r> + <r><c> a / b </c><c> division ( same thing as explode(a,b) ) </c></r> + <r><c> ! a </c><c> boolean not, returns 0 </c></r> + </matrix> +    </p> -  + <p>The following operators compare two string alphabetically: + </p>   <p><matrix> - <r><c> The following operators compare two string alphabetically: </c><c> </c></r> - <r><c> a == b : return 1 if a is equal to b, 0 otherwise </c></r> - <r><c> a != b : return 0 if a is equal to b, 1 otherwise </c></r> - <r><c> a &lt; b : returns 1 if a is lesser than b, 0 otherwise </c></r> - <r><c> a &lt;= b : returns 1 if a is lesser or equal to b, 0 otherwise </c></r> - <r><c> a &gt; b : returns 1 if a is greater than b, 0 otherwise </c></r> - <r><c> a &gt;= b : returns 1 if a is greater or equal to b, 0 otherwise </c></r> + <r><c> a == b </c><c> return 1 if a is equal to b, 0 otherwise </c></r> + <r><c> a != b </c><c> return 0 if a is equal to b, 1 otherwise </c></r> + <r><c> a &lt; b </c><c> returns 1 if a is lesser than b, 0 otherwise </c></r> + <r><c> a &lt;= b </c><c> returns 1 if a is lesser or equal to b, 0 otherwise </c></r> + <r><c> a &gt; b </c><c> returns 1 if a is greater than b, 0 otherwise </c></r> + <r><c> a &gt;= b </c><c> returns 1 if a is greater or equal to b, 0 otherwise </c></r>   </matrix>   </p> - </text> +     -  + type</text> +    <group><seealso/><text>   <p><ref resolved='predef::indices' to='predef::indices'>builtin/indices</ref>, <ref resolved='predef::values' to='predef::values'>builtin/values</ref>, <ref resolved='predef::sscanf' to='predef::sscanf'>builtin/sscanf</ref>, <ref resolved='predef::sprintf' to='predef::sprintf'>builtin/sprintf</ref> and <ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p>   </text></group>
2978:   string</text>      <group><seealso/><text> - <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref to='regexpp'>regexpp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p> + <p><ref resolved='predef::intp' to='intp'>intp</ref>, <ref resolved='predef::listp' to='listp'>listp</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref>, <ref resolved='predef::programp' to='programp'>programp</ref>, <ref resolved='predef::objectp' to='objectp'>objectp</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref>, <ref resolved='predef::floatp' to='floatp'>floatp</ref> and <ref resolved='predef::functionp' to='functionp'>functionp</ref></p>   </text></group>      </doc>
2992:   </p>   </tt>   <p>This function is equal to builtin/sizeof.</p> - </text> +     -  + string</text> +    <group><seealso/><text>   <p><ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p>   </text></group>
3010:   </tt>   <p>Return the position of str2 in str1, if str2 can't be found in str1   -1 is returned.</p> - </text> +     -  + string</text> +    <group><seealso/><text>   <p><ref resolved='predef::sscanf' to='predef::sscanf'>builtin/sscanf</ref> and <ref resolved='predef::explode' to='predef::explode'>builtin/explode</ref></p>   </text></group>
3054:   </tt>   <p>Works like this:   </p> - <p><dl><group><text>mixed *sum_arrays(function fun,mixed *arr1,...)<br/> + <p>mixed *sum_arrays(function fun,mixed *arr1,...)<br/>   {<br/>   <dl><group><text>int e;<br/> - </text></group></dl>mixed *res=allocate(sizeof(arr1));<br/> - <dl><group><text>for(e=0;e&lt;sizeof(arr1);e++)<br/> + mixed *res=allocate(sizeof(arr1));<br/> + for(e=0;e&lt;sizeof(arr1);e++)<br/>   {<br/> - </text></group></dl>res[e]=fun(arr1[e],arr2[e],...);<br/> - <dl><group><text>}<br/> - </text></group></dl>return res;<br/> - }<br/> - </text></group></dl> + <dl><group><text>res[e]=fun(arr1[e],arr2[e],...);<br/> + </text></group></dl>}<br/> + return res;<br/> + </text></group></dl>}<br/> +    </p>   <p>Simple ehh?</p> - </text> +     -  + array</text> +    <group><seealso/><text>   <p><ref resolved='predef::map_array' to='map_array'>map_array</ref>, <ref resolved='predef::filter_array' to='filter_array'>filter_array</ref> and <ref resolved='predef::search_array' to='search_array'>search_array</ref></p>   </text></group>
3121:   </tt>   <p>Returns a functionpointer to the current function, useful for   making recursive lambda-functions.</p> - </text> +     -  + function</text> +    <group><seealso/><text>   <p><ref resolved='predef::get_function' to='predef::get_function'>builtin/get_function</ref>, <ref resolved='predef::function_name' to='predef::function_name'>builtin/function_name</ref>, <ref resolved='predef::function_object' to='predef::function_object'>builtin/function_object</ref> and <ref resolved='predef::backtrace' to='predef::backtrace'>builtin/backtrace</ref></p>   </text></group>
3249:      </doc>   </docgroup> + <docgroup homogen-name='variables' homogen-type='method'> + <method name='variables'/><doc placeholder='true'> + <text> + <p><tt>variables</tt> - how to declare a variable</p> +  + <tt><p>modifier type variable_name_list;<br/> + </p> + </tt> + <p>This is how you declare a global variable. Local variables are defined + in the same way, but you may not use any modifiers for local variables. + The variable_name_list is a comma separated list of the variables + to declare as the type 'type'. Note that '*' binds to the variable + names, not the type. This means that: + </p> + <p><matrix> + <r><c> </c><c> int * i,j; </c></r> + <r><c> </c></r> + </matrix> +  + </p> + <p>Declares i as an array of int, but j will be declared as int. To + declare both i and j as arrays of int you have to write. + </p> + <p><matrix> + <r><c> </c><c> int * i, * j; </c></r> + <r><c> </c></r> + </matrix> +  + </p> + <p>or + </p> + <p><matrix> + <r><c> </c><c> array(int) i,j; </c></r> + <r><c> </c></r> + </matrix> +  + </p> + <p>Modifiers can be zero or more of: static, no_mask and private. + Private means that the variable can not be accessed from programs + that inherit this program. Static means that it can not be accessed + from other objects with the index operator. No_mask means that it + can not be redefined in inheriting programs.</p> +  + lpc</text> +  + <group><seealso/><text> + <p><ref resolved='predef::functions' to='functions'>functions</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='version' homogen-type='method'>   <method name='version'/><doc placeholder='true'>   <text>
3296:   </p>   </tt>   <p>Append the string str onto the file file. Returns number of bytes written.</p> - </text> +     -  + file</text> +    <group><seealso/><text>   <p><ref to='read_file'>read_file</ref></p>   </text></group>