Branch: Tag:

1995-08-09

1995-08-09 10:21:55 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

ulpc dist

Rev: bin/create_testsuite:1.1.1.1
Rev: bin/hilfe.lpc:1.1.1.1
Rev: bin/rsif:1.1.1.1
Rev: bin/uhttpd.lpc:1.1.1.1
Rev: doc/README:1.1.1.1
Rev: doc/builtin/aggregate:1.1.1.1
Rev: doc/builtin/aggregate_list:1.1.1.1
Rev: doc/builtin/aggregate_mapping:1.1.1.1
Rev: doc/builtin/all_efuns:1.1.1.1
Rev: doc/builtin/allocate:1.1.1.1
Rev: doc/builtin/arrayp:1.1.1.1
Rev: doc/builtin/backtrace:1.1.1.1
Rev: doc/builtin/call_function:1.1.1.1
Rev: doc/builtin/call_out:1.1.1.1
Rev: doc/builtin/call_out_info:1.1.1.1
Rev: doc/builtin/catch:1.1.1.1
Rev: doc/builtin/clone:1.1.1.1
Rev: doc/builtin/combine_path:1.1.1.1
Rev: doc/builtin/compile_file:1.1.1.1
Rev: doc/builtin/compile_string:1.1.1.1
Rev: doc/builtin/copy_value:1.1.1.1
Rev: doc/builtin/crypt:1.1.1.1
Rev: doc/builtin/ctime:1.1.1.1
Rev: doc/builtin/destruct:1.1.1.1
Rev: doc/builtin/equal:1.1.1.1
Rev: doc/builtin/exit:1.1.1.1
Rev: doc/builtin/explode:1.1.1.1
Rev: doc/builtin/find_call_out:1.1.1.1
Rev: doc/builtin/floatp:1.1.1.1
Rev: doc/builtin/function_name:1.1.1.1
Rev: doc/builtin/function_object:1.1.1.1
Rev: doc/builtin/functionp:1.1.1.1
Rev: doc/builtin/hash:1.1.1.1
Rev: doc/builtin/implode:1.1.1.1
Rev: doc/builtin/indices:1.1.1.1
Rev: doc/builtin/intp:1.1.1.1
Rev: doc/builtin/listp:1.1.1.1
Rev: doc/builtin/lower_case:1.1.1.1
Rev: doc/builtin/m_delete:1.1.1.1
Rev: doc/builtin/mappingp:1.1.1.1
Rev: doc/builtin/mkmapping:1.1.1.1
Rev: doc/builtin/next_object:1.1.1.1
Rev: doc/builtin/object_program:1.1.1.1
Rev: doc/builtin/objectp:1.1.1.1
Rev: doc/builtin/programp:1.1.1.1
Rev: doc/builtin/query_host_name:1.1.1.1
Rev: doc/builtin/query_num_arg:1.1.1.1
Rev: doc/builtin/random:1.1.1.1
Rev: doc/builtin/regexpp:1.1.1.1
Rev: doc/builtin/remove_call_out:1.1.1.1
Rev: doc/builtin/replace:1.1.1.1
Rev: doc/builtin/reverse:1.1.1.1
Rev: doc/builtin/rusage:1.1.1.1
Rev: doc/builtin/search:1.1.1.1
Rev: doc/builtin/sizeof:1.1.1.1
Rev: doc/builtin/sscanf:1.1.1.1
Rev: doc/builtin/stringp:1.1.1.1
Rev: doc/builtin/sum:1.1.1.1
Rev: doc/builtin/this_object:1.1.1.1
Rev: doc/builtin/throw:1.1.1.1
Rev: doc/builtin/time:1.1.1.1
Rev: doc/builtin/trace:1.1.1.1
Rev: doc/builtin/upper_case:1.1.1.1
Rev: doc/builtin/values:1.1.1.1
Rev: doc/builtin/zero_type:1.1.1.1
Rev: doc/files/cd:1.1.1.1
Rev: doc/files/exec:1.1.1.1
Rev: doc/files/file:1.1.1.1
Rev: doc/files/file_stat:1.1.1.1
Rev: doc/files/fork:1.1.1.1
Rev: doc/files/get_dir:1.1.1.1
Rev: doc/files/getcwd:1.1.1.1
Rev: doc/files/mkdir:1.1.1.1
Rev: doc/files/mv:1.1.1.1
Rev: doc/files/perror:1.1.1.1
Rev: doc/files/port:1.1.1.1
Rev: doc/files/rm:1.1.1.1
Rev: doc/lpc/command_line_options:1.1.1.1
Rev: doc/lpc/control_structures:1.1.1.1
Rev: doc/lpc/hilfe.hilfe:1.1.1.1
Rev: doc/lpc/how_to_make_modules:1.1.1.1
Rev: doc/manual/i-overview.html:1.1.1.1
Rev: doc/manual/index.html:1.1.1.1
Rev: doc/manual/t-hello.html:1.1.1.1
Rev: doc/manual/ulpc-inside3.gif:1.1.1.1
Rev: doc/math/acos:1.1.1.1
Rev: doc/math/asin:1.1.1.1
Rev: doc/math/atan:1.1.1.1
Rev: doc/math/ceil:1.1.1.1
Rev: doc/math/cos:1.1.1.1
Rev: doc/math/exp:1.1.1.1
Rev: doc/math/floor:1.1.1.1
Rev: doc/math/log:1.1.1.1
Rev: doc/math/pow:1.1.1.1
Rev: doc/math/sin:1.1.1.1
Rev: doc/math/sqrt:1.1.1.1
Rev: doc/math/tan:1.1.1.1
Rev: doc/operators/addition:1.1.1.1
Rev: doc/regexp/regexp:1.1.1.1
Rev: doc/simulated/PI:1.1.1.1
Rev: doc/simulated/capitalize:1.1.1.1
Rev: doc/simulated/code_value:1.1.1.1
Rev: doc/simulated/describe_backtrace:1.1.1.1
Rev: doc/simulated/file_size:1.1.1.1
Rev: doc/simulated/filter_array:1.1.1.1
Rev: doc/simulated/get_function:1.1.1.1
Rev: doc/simulated/getenv:1.1.1.1
Rev: doc/simulated/l_sizeof:1.1.1.1
Rev: doc/simulated/m_indices:1.1.1.1
Rev: doc/simulated/m_sizeof:1.1.1.1
Rev: doc/simulated/m_values:1.1.1.1
Rev: doc/simulated/map_array:1.1.1.1
Rev: doc/simulated/master:1.1.1.1
Rev: doc/simulated/member_array:1.1.1.1
Rev: doc/simulated/popen:1.1.1.1
Rev: doc/simulated/previous_object:1.1.1.1
Rev: doc/simulated/read_bytes:1.1.1.1
Rev: doc/simulated/regexp:1.1.1.1
Rev: doc/simulated/search_array:1.1.1.1
Rev: doc/simulated/sort_array:1.1.1.1
Rev: doc/simulated/spawn:1.1.1.1
Rev: doc/simulated/strlen:1.1.1.1
Rev: doc/simulated/strstr:1.1.1.1
Rev: doc/simulated/sum_arrays:1.1.1.1
Rev: doc/simulated/this_function:1.1.1.1
Rev: doc/simulated/write:1.1.1.1
Rev: doc/simulated/write_file:1.1.1.1
Rev: doc/sprintf/sprintf:1.1.1.1
Rev: doc/types/array:1.1.1.1
Rev: doc/types/float:1.1.1.1
Rev: doc/types/function:1.1.1.1
Rev: doc/types/int:1.1.1.1
Rev: doc/types/list:1.1.1.1
Rev: doc/types/mapping:1.1.1.1
Rev: doc/types/object:1.1.1.1
Rev: doc/types/program:1.1.1.1
Rev: doc/types/string:1.1.1.1
Rev: lib/conftest.h:1.1.1.1
Rev: lib/master.lpc:1.1.1.1
Rev: lib/simulate.lpc:1.1.1.1
Rev: lib/testsuite.lpc:1.1.1.1
Rev: src/BUGS:1.1.1.1
Rev: src/COPYING:1.1.1.1
Rev: src/COPYRIGHT:1.1.1.1
Rev: src/DISCLAIMER:1.1.1.1
Rev: src/Makefile.in:1.1.1.1
Rev: src/README:1.1.1.1
Rev: src/add_efun.c:1.1.1.1
Rev: src/add_efun.h:1.1.1.1
Rev: src/alloca.c:1.1.1.1
Rev: src/array.c:1.1.1.1
Rev: src/array.h:1.1.1.1
Rev: src/backend.c:1.1.1.1
Rev: src/backend.h:1.1.1.1
Rev: src/builtin_efuns.c:1.1.1.1
Rev: src/builtin_efuns.h:1.1.1.1
Rev: src/call_out.c:1.1.1.1
Rev: src/call_out.h:1.1.1.1
Rev: src/callback.c:1.1.1.1
Rev: src/callback.h:1.1.1.1
Rev: src/config.h:1.1.1.1
Rev: src/configure.in:1.1.1.1
Rev: src/debug.c:1.1.1.1
Rev: src/debug.h:1.1.1.1
Rev: src/docode.c:1.1.1.1
Rev: src/docode.h:1.1.1.1
Rev: src/dynamic_buffer.c:1.1.1.1
Rev: src/dynamic_buffer.h:1.1.1.1
Rev: src/efun.h:1.1.1.1
Rev: src/error.c:1.1.1.1
Rev: src/error.h:1.1.1.1
Rev: src/fd_control.c:1.1.1.1
Rev: src/fd_control.h:1.1.1.1
Rev: src/fsort.c:1.1.1.1
Rev: src/fsort.h:1.1.1.1
Rev: src/global.h:1.1.1.1
Rev: src/hashtable.c:1.1.1.1
Rev: src/hashtable.h:1.1.1.1
Rev: src/install-sh:1.1.1.1
Rev: src/interpret.c:1.1.1.1
Rev: src/interpret.h:1.1.1.1
Rev: src/language.y:1.1.1.1
Rev: src/las.c:1.1.1.1
Rev: src/las.h:1.1.1.1
Rev: src/lex.c:1.1.1.1
Rev: src/lex.h:1.1.1.1
Rev: src/list.c:1.1.1.1
Rev: src/list.h:1.1.1.1
Rev: src/lpc_types.c:1.1.1.1
Rev: src/lpc_types.h:1.1.1.1
Rev: src/machine.h.in:1.1.1.1
Rev: src/macros.h:1.1.1.1
Rev: src/main.c:1.1.1.1
Rev: src/main.h:1.1.1.1
Rev: src/mapping.c:1.1.1.1
Rev: src/mapping.h:1.1.1.1
Rev: src/memory.c:1.1.1.1
Rev: src/memory.h:1.1.1.1
Rev: src/module.c:1.1.1.1
Rev: src/module.h:1.1.1.1
Rev: src/modules/efuns.c:1.1.1.1
Rev: src/modules/files/Makefile.in:1.1.1.1
Rev: src/modules/files/configure.in:1.1.1.1
Rev: src/modules/files/datagram.c:1.1.1.1
Rev: src/modules/files/efuns.c:1.1.1.1
Rev: src/modules/files/file.c:1.1.1.1
Rev: src/modules/files/file.h:1.1.1.1
Rev: src/modules/files/file_machine.h.in:1.1.1.1
Rev: src/modules/files/socket.c:1.1.1.1
Rev: src/modules/math/Makefile.in:1.1.1.1
Rev: src/modules/math/configure.in:1.1.1.1
Rev: src/modules/math/math.c:1.1.1.1
Rev: src/modules/regexp/Makefile.in:1.1.1.1
Rev: src/modules/regexp/configure.in:1.1.1.1
Rev: src/modules/regexp/glue.c:1.1.1.1
Rev: src/modules/regexp/regexp.c:1.1.1.1
Rev: src/modules/regexp/regexp.h:1.1.1.1
Rev: src/modules/sprintf/Makefile.in:1.1.1.1
Rev: src/modules/sprintf/configure.in:1.1.1.1
Rev: src/modules/sprintf/sprintf.c:1.1.1.1
Rev: src/object.c:1.1.1.1
Rev: src/object.h:1.1.1.1
Rev: src/opcodes.c:1.1.1.1
Rev: src/opcodes.h:1.1.1.1
Rev: src/operators.c:1.1.1.1
Rev: src/operators.h:1.1.1.1
Rev: src/otable.h:1.1.1.1
Rev: src/port.c:1.1.1.1
Rev: src/port.h:1.1.1.1
Rev: src/program.c:1.1.1.1
Rev: src/program.h:1.1.1.1
Rev: src/rusage.c:1.1.1.1
Rev: src/rusage.h:1.1.1.1
Rev: src/stralloc.c:1.1.1.1
Rev: src/stralloc.h:1.1.1.1
Rev: src/stuff.c:1.1.1.1
Rev: src/stuff.h:1.1.1.1
Rev: src/svalue.c:1.1.1.1
Rev: src/svalue.h:1.1.1.1
Rev: src/todo:1.1.1.1
Rev: src/types.h:1.1.1.1
Rev: src/ualarm.c:1.1.1.1

1: + <?xml version='1.0' encoding='utf-8'?> + <autodoc> + <namespace name='predef'> + <docgroup homogen-name='PI' homogen-type='constant'> + <constant name='PI'/><doc placeholder='true'> + <text> + <p><tt>PI</tt> - pi</p>    -  + <tt><p>pi<br/> + </p> + </tt> + <p>This is not a function, it is a constant added by simulate.lpc. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='acos' homogen-type='method'> + <method name='acos'/><doc placeholder='true'> + <text> + <p><tt>acos</tt> - Trigonometrical inverse cosine</p> +  + <tt><p>float acos(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the arcus cosinus value for f.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='addition' homogen-type='method'> + <method name='addition'/><doc placeholder='true'> + <text> + <p><tt>addition</tt> - add things together</p> +  + <tt><p>a + b<br/> + or<br/> + mixed sum(mixed ...)<br/> + </p> + </tt> + <p>For ints and floats this operator simply adds the two operators + together. For strings and arrays, concatenation is done. For lists + and mapping this creates a new list with all indices and data as + in a and b. Note that this can cause a list or mapping to contain + several equal indices. Also, when adding a string to an int or float + the number is converted to a printable string first.</p> + </text> +  + <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> ({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> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref to='subtraction'>subtraction</ref>, <ref resolved='predef::sum' to='predef::sum'>efun/sum</ref> and <ref to='multiplication'>multiplication</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='aggregate' homogen-type='method'> + <method name='aggregate'/><doc placeholder='true'> + <text> + <p><tt>aggregate</tt> - construct an array</p> +  + <tt><p>mixed *aggregate(mixed ... <i>elems</i>);<br/> + or<br/> + ({ elem1, elem2, ... })<br/> + </p> + </tt> + <p>Construct an array with the arguments as indexes. This function + could be written in LPC as: + </p> + <p>mixed *aggregate(mixed ... elems) { return elems; }</p> + </text> +  + <group><note/><text> + <p>Arrays are dynamically allocated there is no need to declare them + like int a[10]=allocate(10); (and it isn't possible either) like + in C, just int *a=allocate(10); will do.</p> + </text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::sizeof' to='sizeof'>sizeof</ref>, <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref> and <ref resolved='predef::allocate' to='allocate'>allocate</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='aggregate' homogen-type='method'> + <method name='aggregate'/><doc placeholder='true'> + <text> + <p><tt>aggregate</tt> - construct a list</p> +  + <tt><p>list aggregate_list(mixed ... <i>elems</i>);<br/> + or<br/> + (&lt; elem1, elem2, ... &gt;)<br/> + </p> + </tt> + <p>Construct an list with the arguments as indexes. This function + could be written in LPC as: + </p> + <p>list aggregate(mixed ... elems) { return mklist(elems); }</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::sizeof' to='sizeof'>sizeof</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref to='mklist'>mklist</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='aggregate_mapping' homogen-type='method'> + <method name='aggregate_mapping'/><doc placeholder='true'> + <text> + <p><tt>aggregate_mapping</tt> - construct a mapping</p> +  + <tt><p>mapping aggregate_list(mixed ... <i>elems</i>);<br/> + or<br/> + (&lt; key1:val1, key2:val2, ... &gt;)<br/> + </p> + </tt> + <p>Groups the arguments together two and two to key-index pairs and + creates a mapping of those pairs. The second syntax is always + preferable.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::sizeof' to='sizeof'>sizeof</ref>, <ref resolved='predef::mappingp' to='mappingp'>mappingp</ref> and <ref resolved='predef::mkmapping' to='mkmapping'>mkmapping</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='all_efuns' homogen-type='method'> + <method name='all_efuns'/><doc placeholder='true'> + <text> + <p><tt>all_efuns</tt> - return all efuns</p> +  + <tt><p>mapping (string:mixed) <i>all_efuns</i>();<br/> + </p> + </tt> + <p>Return a mapping containing all efuns, indexed on the names of the + efuns, and with the value of the efun as argument. +  + SEE ALSO + add_efun + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='allocate' homogen-type='method'> + <method name='allocate'/><doc placeholder='true'> + <text> + <p><tt>allocate</tt> - allocate an array + SYNTAX + mixed *allocate(int size, [ string type ]);</p> +  + <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> + </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> +  + <group><note/><text> + <p>Arrays are dynamically allocated there is no need to declare them + like int a[10]=allocate(10); (and it isn't possible either) like + in C, just int *a=allocate(10); will do.</p> + </text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::sizeof' to='sizeof'>sizeof</ref>, <ref resolved='predef::aggregate' to='aggregate'>aggregate</ref> and <ref resolved='predef::arrayp' to='arrayp'>arrayp</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='array' homogen-type='method'> + <method name='array'/><doc placeholder='true'> + <text> + <p><tt>array</tt> - an array of values</p> +  + <tt><p>({ 1, 2, 3 })<br/> + allocate(10);<br/> + </p> + </tt> + <p>Arrays are basically a place to store a number of other values.</p> +  + <p>Arrays in lpc are allocated blocks of values. They are dynamically<br/> + allocated and does not need to be declared as in C. The values in<br/> + the array can be set when creating the array as in the first<br/> + construction or anytime afterwards like this: arr[index]=data where<br/> + index is an integer greater or equal to 0 and smaller than the array<br/> + size. Note that arrays are shared and use reference counts to keep<br/> + track of their references. This will have the effect that you can<br/> + <dl><group><text>have two variables pointing to the same array, and when you change<br/> + </text></group></dl>an index in in it, both variables will show the change.<br/> +  + </p> + <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/> + a &amp; b : intersection, return an array with all values that are<br/> + </text></group></dl><matrix> + <r><c> </c><c> present in both a and b </c></r> + <r><c> </c></r> + </matrix> + <dl><group><text>a | b : union, return an array with all values that are present in<br/> + <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 1<br/> + </text></group></dl>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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='arrayp' homogen-type='method'> + <method name='arrayp'/><doc placeholder='true'> + <text> + <p><tt>arrayp</tt> - is the argument an array?</p> +  + <tt><p>int arrayp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is an array, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='asin' homogen-type='method'> + <method name='asin'/><doc placeholder='true'> + <text> + <p><tt>asin</tt> - Trigonometrical inverse sine</p> +  + <tt><p>float asin(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the arcus sinus value for f.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='atan' homogen-type='method'> + <method name='atan'/><doc placeholder='true'> + <text> + <p><tt>atan</tt> - Trigonometrical inverse tangent</p> +  + <tt><p>float atan(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the arcus tangent value for f.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='backtrace' homogen-type='method'> + <method name='backtrace'/><doc placeholder='true'> + <text> + <p><tt>backtrace</tt> - get a description of the call stack</p> +  + <tt><p>mixed *backtrace();<br/> + </p> + </tt> + <p>This function returns a description of the call stack at this moment. + The description is returned in an array with one entry for each call + 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/> + </text></group></dl>})<br/> +  + </p> + <p>The current call frame will be last in the array, and the one above + that the last but one and so on.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::catch' to='catch'>catch</ref> and <ref resolved='predef::throw' to='throw'>throw</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='call_function' homogen-type='method'> + <method name='call_function'/><doc placeholder='true'> + <text> + <p><tt>call_function</tt> - call a function with arguments</p> +  + <tt><p>mixed call_function(function <i>fun</i>,mixed ... <i>args</i>);<br/> + or<br/> + mixed fun ( mixed ... <i>args</i> );<br/> + </p> + </tt> + <p>This function takes a a function pointer as first argument and calls + 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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='call_out' homogen-type='method'> + <method name='call_out'/><doc placeholder='true'> + <text> + <p><tt>call_out</tt> - make a delayed call to a function</p> +  + <tt><p>void call_out(function <i>f</i>, int <i>delay</i>, mixed ... <i>args</i>);<br/> + </p> + </tt> + <p>Call_out places a call to the function f with the argument args + in a queue to be called in about delay seconds.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::remove_call_out' to='remove_call_out'>remove_call_out</ref>, <ref resolved='predef::find_call_out' to='find_call_out'>find_call_out</ref> and <ref resolved='predef::call_out_info' to='call_out_info'>call_out_info</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='call_out_info' homogen-type='method'> + <method name='call_out_info'/><doc placeholder='true'> + <text> + <p><tt>call_out_info</tt> - get info about all call outs</p> +  + <tt><p>mixed **call_out_info();<br/> + </p> + </tt> + <p>This function returns an array with one entry for each entry in the + call out queue. The first in the queue will be in index 0. Each index + 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/> + </text></group></dl>})<br/> + </p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::call_out' to='call_out'>call_out</ref>, <ref resolved='predef::find_call_out' to='find_call_out'>find_call_out</ref> and <ref resolved='predef::remove_call_out' to='remove_call_out'>remove_call_out</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='capitalize' homogen-type='method'> + <method name='capitalize'/><doc placeholder='true'> + <text> + <p><tt>capitalize</tt> - capitalize a string + SYNTAX + string capitalize(string str)</p> +  + <p>Convert the first character in str to upper case, and return the + new string.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='catch' homogen-type='method'> + <method name='catch'/><doc placeholder='true'> + <text> + <p><tt>catch</tt> - catch any errors that may occur. + SYNTAX + mixed catch(mixed expr);</p> +  + <p>Evaluate expr. If there is no error or throw 0 is returned. Otherwise + the value thrown will be returned. Driver errors such as 1/0 will + throw an array where the first index is a string describing the error + and the second the backtrace() at that point.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::throw' to='throw'>throw</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='cd' homogen-type='method'> + <method name='cd'/><doc placeholder='true'> + <text> + <p><tt>cd</tt> - change directory</p> +  + <tt><p>int cd(string <i>s</i>);<br/> + </p> + </tt> + <p>Change the current directory for the whole LPC process, return + 1 for success, 0 otherwise.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::getcwd' to='predef::getcwd'>files/getcwd</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='ceil' homogen-type='method'> + <method name='ceil'/><doc placeholder='true'> + <text> + <p><tt>ceil</tt> - Truncate a number upward</p> +  + <tt><p>float ceil(float <i>f</i>);<br/> + </p> + </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> +  + <group><seealso/><text> + <p><ref resolved='predef::floor' to='predef::floor'>math/floor</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='clone' homogen-type='method'> + <method name='clone'/><doc placeholder='true'> + <text> + <p><tt>clone</tt> - clone an object from a program</p> +  + <tt><p>object clone(program <i>p</i>,mixed ... <i>args</i>);<br/> + </p> + </tt> + <p>clone() creates an object from the program p. Or in C++ terms: + It creates an instance of the class p. This clone will first have + all global variables initalized, and then create() will be called + with args as arguments.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::destruct' to='destruct'>destruct</ref>, <ref resolved='predef::compile_string' to='compile_string'>compile_string</ref> and <ref resolved='predef::compile_file' to='compile_file'>compile_file</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='code_value' homogen-type='method'> + <method name='code_value'/><doc placeholder='true'> + <text> + <p><tt>code_value</tt> - code a value into a string.</p> +  + <tt><p>string code_value(mixed <i>v</i>);<br/> + </p> + </tt> + <p>Return a string that contains an almost readable representation of the value v. + </p> + <p/> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='combine_path' homogen-type='method'> + <method name='combine_path'/><doc placeholder='true'> + <text> + <p><tt>combine_path</tt> - concatenate paths</p> +  + <tt><p>string combine_path(string <i>absolute</i>, string <i>relative</i>);<br/> + </p> + </tt> + <p>Concatenate a relative path to an absolute path and remove any + "//", "/.." or "/." to produce a straightforward absolute path + as a result.</p> + </text> +  + <group><example/><text> + <tt><p>&gt; combine_path("/foo/bar/","..");<br/> + Result: /foo<br/> + &gt; combine_path("/foo/bar/","../apa.c");<br/> + Result: /foo/apa.c<br/> + &gt; combine_path("/foo/bar","./sune.c");<br/> + Result: /foo/bar/sune.c<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::getcwd' to='getcwd'>getcwd</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='compile_file' homogen-type='method'> + <method name='compile_file'/><doc placeholder='true'> + <text> + <p><tt>compile_file</tt> - compile a file to a program</p> +  + <tt><p>program compile_file(string <i>filename</i>);<br/> + </p> + </tt> + <p>This function will compile the filename to an LPC program that can + later be used for cloning.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::clone' to='clone'>clone</ref> and <ref resolved='predef::compile_string' to='compile_string'>compile_string</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='compile_string' homogen-type='method'> + <method name='compile_string'/><doc placeholder='true'> + <text> + <p><tt>compile_string</tt> - compile a string to a program</p> +  + <tt><p>program compile_string(string <i>prog</i>, string <i>name</i>);<br/> + </p> + </tt> + <p>Compile_string takes a complete LPC program as an argument in a the + string prog and compiles it to clonable program. The second argument + will be used as the file name of the program and will be used for + error messages and such.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::compile_string' to='compile_string'>compile_string</ref> and <ref resolved='predef::clone' to='clone'>clone</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='copy_value' homogen-type='method'> + <method name='copy_value'/><doc placeholder='true'> + <text> + <p><tt>copy_value</tt> - copy a value recursively</p> +  + <tt><p>mixed copy_value(mixed <i>value</i>);<br/> + </p> + </tt> + <p>Copy value will copy the value given to it recursively. If the result + value is changed destructively (only possible for lists, arrays and + mappings) the copied value will not be changed. The resulting value + will always be equal to the copied (tested with the efun equal), but + they may not the the same value. (tested with ==)</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::equal' to='equal'>equal</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='cos' homogen-type='method'> + <method name='cos'/><doc placeholder='true'> + <text> + <p><tt>cos</tt> - Trigonometrical cosine</p> +  + <tt><p>float cos(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the cosinus value for f.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='crypt' homogen-type='method'> + <method name='crypt'/><doc placeholder='true'> + <text> + <p><tt>crypt</tt> - crypt a password</p> +  + <tt><p>string crypt(string <i>password</i>);<br/> + or<br/> + int crypt(string <i>typed_password</i>, string <i>crypted_password</i>);<br/> + </p> + </tt> + <p>This function crypts and verifies a short string. (normally only + the first 8 characters are significant) The first syntax crypts + the string password into something that is hopefully hard to decrypt, + and the second function crypts the first string and verifies that the + crypted result matches the second argument and returns 1 if they + matched, 0 otherwise.</p> + </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> +  + </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'> + <method name='ctime'/><doc placeholder='true'> + <text> + <p><tt>ctime</tt> - convert time int to readable date string</p> +  + <tt><p>string ctime(int <i>current_time</i>);<br/> + </p> + </tt> + <p>Convert the output from a previous call to time() into a readable + string containing the currnent year, month, day and time.</p> + </text> +  + <group><example/><text> + <tt><p>&gt; ctime(time());<br/> + Result: Wed Jan 14 03:36:08 1970<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::time' to='time'>time</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='describe_bactrace' homogen-type='method'> + <method name='describe_bactrace'/><doc placeholder='true'> + <text> + <p><tt>describe_bactrace</tt> - make a backtrace readable</p> +  + <tt><p>string describe_backtrace(mixed **<i>backtrace</i>);<br/> + </p> + </tt> + <p>Describe backtrace returns a string containing a readable message + that describes where the backtrace was made. The argument 'backtrace' + should normally be the return value from a call to backtrace()</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::backtrace' to='predef::backtrace'>builtin/backtrace</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='destruct' homogen-type='method'> + <method name='destruct'/><doc placeholder='true'> + <text> + <p><tt>destruct</tt> - destruct an object</p> +  + <tt><p>void destruct(object <i>o</i>);<br/> + </p> + </tt> + <p>Destruct marks an object as destructed, all pointers and function + pointers to this object will become zero. The destructed object will + be freed from memory as soon as possible.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::clone' to='clone'>clone</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='equal' homogen-type='method'> + <method name='equal'/><doc placeholder='true'> + <text> + <p><tt>equal</tt> - check if two values are equal or not</p> +  + <tt><p>int equal(mixed <i>a</i>, mixed <i>b</i>);<br/> + </p> + </tt> + <p>This function checks if the values a and b are equal. For all types but + arrays, lists and mappings, this operation is the same as doing a == b. + For arrays, mappings and lists however, their contents are checked + recursively, and if all their contents are the same and in the same + place, they are considered equal.</p> + </text> +  + <group><example/><text> + <tt><p>&gt; ({ 1 }) == ({ 1 });<br/> + Result: 0<br/> + &gt; equal( ({ 1 }), ({ 1 }) );<br/> + Result: 1<br/> + &gt; <br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::copy_value' to='copy_value'>copy_value</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='exec' homogen-type='method'> + <method name='exec'/><doc placeholder='true'> + <text> + <p><tt>exec</tt> - execute a program</p> +  + <tt><p>int exec(string ... <i>args</i>);<br/> + </p> + </tt> + <p>This function transforms the uLPC process into a process running + the program specified in args. The args will be sent as argv[] to + the new program. This function only returns if something went wrong + during exec(), and in that case it returns zero.</p> + </text> +  + <group><note/><text> + <p>The uLPC driver _dies_ when this function is called. You must use + fork() if you wish to execute a program and still run the uLPC + driver.</p> + </text></group> +  + <group><example/><text> + <tt><p>exec("ls","-l");<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::fork' to='predef::fork'>files/fork</ref> and <ref to='file-&gt;pipe'>file-&gt;pipe</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='exit' homogen-type='method'> + <method name='exit'/><doc placeholder='true'> + <text> + <p><tt>exit</tt> - exit LPC interpreter</p> +  + <tt><p>void exit(int <i>returncode</i>);<br/> + </p> + </tt> + <p>This function exits the whole 'ulpc' program with the return code + given. Using exit() with any other value than 0 indicates that + something went wrong during execution. See your system manuals for + more information about return codes. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='exp' homogen-type='method'> + <method name='exp'/><doc placeholder='true'> + <text> + <p><tt>exp</tt> - Natural exponent</p> +  + <tt><p>float exp(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the natural exponent of f. + log( exp( x ) ) == x as long as exp(x) doesn't overflow an int.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='explode' homogen-type='method'> + <method name='explode'/><doc placeholder='true'> + <text> + <p><tt>explode</tt> - explode a string on a delimeter</p> +  + <tt><p>string *explode(string <i>victim</i>, string <i>delimeter</i>);<br/> + or<br/> + victim / delimiter<br/> + </p> + </tt> + <p>Explode divides the string called victim at every occurance of + the string delimeter and returns the resulting parts in an array. + If delimeter is an empty string, victim will be divided into strings + of length 1.</p> + </text> +  + <group><example/><text> + <tt><p>&gt; explode("foobar","o");<br/> + Result: ({ "f", "", "bar" })<br/> + &gt; explode("10101001010100010101","10");<br/> + Result: ({ "", "", "", "0", "", "", "00", "", "1" })<br/> + &gt; explode("/foo/bar/gazonk","/");<br/> + Result: ({ "", "foo", "bar", "gazonk" })<br/> + &gt; explode("foobar","");<br/> + Result: ({ "f", "o", "o", "b", "a", "r" })<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::implode' to='implode'>implode</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='file_size' homogen-type='method'> + <method name='file_size'/><doc placeholder='true'> + <text> + <p><tt>file_size</tt> - return the size of a file in bytes</p> +  + <tt><p>int file_size(string <i>file</i>);<br/> + </p> + </tt> + <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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='file_stat' homogen-type='method'> + <method name='file_stat'/><doc placeholder='true'> + <text> + <p><tt>file_stat</tt> - stat a file</p> +  + <tt><p>int *file_stat(string <i>file</i>);<br/> + or<br/> + int *file_stat(string <i>file</i>, <i>1</i>);<br/> + or<br/> + 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> + </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/> + <dl><group><text>* -3 for links,<br/> + * -4 for otherwise<br/> + */<br/> + </text></group></dl></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> +  + <group><seealso/><text> + <p><ref resolved='predef::get_dir' to='predef::get_dir'>files/get_dir</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='filter_array' homogen-type='method'> + <method name='filter_array'/><doc placeholder='true'> + <text> + <p><tt>filter_array</tt> - filter an array through a function</p> +  + <tt><p>mixed *filter_array(mixed *<i>arr</i>,function <i>fun</i>,mixed ... <i>args</i>);<br/> + or<br/> + mixed *filter_array(object *<i>arr</i>,string <i>fun</i>,mixed ... <i>args</i>);<br/> + or<br/> + mixed *filter_array(function *<i>arr</i>,-<i>1</i>,mixed ... <i>args</i>);<br/> + </p> + </tt> + <p>First syntax: + Filter array returns an array holding the items of arr for which + fun returns true. + </p> + <p>Second syntax: + Filter array calls fun in all the objects in the array arr, and + return all objects that returned true. + </p> + <p>Third syntax: + Filter array calls all functionpointers in the array arr, and + return all that returned true.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='find_call_out' homogen-type='method'> + <method name='find_call_out'/><doc placeholder='true'> + <text> + <p><tt>find_call_out</tt> - find a call out in the queue</p> +  + <tt><p>int find_call_out(function <i>f</i>);<br/> + </p> + </tt> + <p>This function searches the call out queue, and returns the time left + to this call out will be done in seconds. If no call is found, + zero_type(find_call_out(f)) will return 1.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::call_out' to='call_out'>call_out</ref>, <ref resolved='predef::remove_call_out' to='remove_call_out'>remove_call_out</ref> and <ref resolved='predef::call_out_info' to='call_out_info'>call_out_info</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='float' homogen-type='method'> + <method name='float'/><doc placeholder='true'> + <text> + <p><tt>float</tt> - floating point numbers</p> +  + <tt><p>0.9<br/> + 1.0<br/> + 2.7e7<br/> + </p> + </tt> + <p>This type stores a floating point number, normally it use 4 bytes + of storage when used in a global variable. + </p> + <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> + </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> +  + <group><seealso/><text> + <p><ref resolved='predef::float' to='float'>float</ref> and <ref resolved='predef::' to='predef::'>modules/math</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='floatp' homogen-type='method'> + <method name='floatp'/><doc placeholder='true'> + <text> + <p><tt>floatp</tt> - is the argument an float?</p> +  + <tt><p>int floatp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is a float, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='floor' homogen-type='method'> + <method name='floor'/><doc placeholder='true'> + <text> + <p><tt>floor</tt> - Truncate a number downward</p> +  + <tt><p>float floor(float <i>f</i>);<br/> + </p> + </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> +  + <group><seealso/><text> + <p><ref resolved='predef::ceil' to='predef::ceil'>math/ceil</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='fork' homogen-type='method'> + <method name='fork'/><doc placeholder='true'> + <text> + <p><tt>fork</tt> - fork the process in two</p> +  + <tt><p>int fork();<br/> + </p> + </tt> + <p>Fork splits the process in two, and for the parent it returns the + pid of the child. Refer to your unix manual for further details.</p> + </text> +  + <group><note/><text> + <p>This function cause endless bugs if used without proper care.</p> + </text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::exec' to='predef::exec'>files/exec</ref> and <ref to='file-&gt;pipe'>file-&gt;pipe</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='function' homogen-type='method'> + <method name='function'/><doc placeholder='true'> + <text> + <p><tt>function</tt> - a function pointer</p> +  + <tt><p>foo /* if foo is a function in this object */<br/> + bar::foo /* if foo is a function in the inherited program 'bar' */<br/> + o-&gt;foo /* function (or variable) foo in the object o */<br/> + </p> + </tt> + <p>A functionpointer is a reference to a function in an object. It can be + called with call_function which can also be written as just (). + 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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='function_name' homogen-type='method'> + <method name='function_name'/><doc placeholder='true'> + <text> + <p><tt>function_name</tt> - return the name of a function, if known</p> +  + <tt><p>string function_name(function <i>f</i>);<br/> + </p> + </tt> + <p>This function returns the name of the function f. If the function is + a pre-defined function in the driver, zero will be returned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::function_object' to='function_object'>function_object</ref> and <ref resolved='predef::get_function' to='get_function'>get_function</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='function_object' homogen-type='method'> + <method name='function_object'/><doc placeholder='true'> + <text> + <p><tt>function_object</tt> - return what object a function is in</p> +  + <tt><p>object function_object(function <i>f</i>);<br/> + </p> + </tt> + <p>Function_object will return the object the function f is in. If the + function is a predefined function from the driver, zero will be + returned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::function_name' to='function_name'>function_name</ref> and <ref resolved='predef::get_function' to='get_function'>get_function</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='functionp' homogen-type='method'> + <method name='functionp'/><doc placeholder='true'> + <text> + <p><tt>functionp</tt> - is the argument an function?</p> +  + <tt><p>int functionp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is a function, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='get_dir' homogen-type='method'> + <method name='get_dir'/><doc placeholder='true'> + <text> + <p><tt>get_dir</tt> - read a directory</p> +  + <tt><p>string *get_dir(string <i>dirname</i>);<br/> + </p> + </tt> + <p>Return an array of all filenames in the directory dir, or zero if + no such directory exists.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='get_function' homogen-type='method'> + <method name='get_function'/><doc placeholder='true'> + <text> + <p><tt>get_function</tt> - fetch a function from an object</p> +  + <tt><p>function get_function(object <i>o</i>, string <i>name</i>);<br/> + </p> + </tt> + <p>Defined as: return o[name]; + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='getcwd' homogen-type='method'> + <method name='getcwd'/><doc placeholder='true'> + <text> + <p><tt>getcwd</tt> - return current working directory</p> +  + <tt><p>string getcwd();<br/> + </p> + </tt> + <p>getcwd returns the current working directory.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::cd' to='predef::cd'>files/cd</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='getenv' homogen-type='method'> + <method name='getenv'/><doc placeholder='true'> + <text> + <p><tt>getenv</tt> - get an environment variable</p> +  + <tt><p>string getenv(string <i>varname</i>);<br/> + </p> + </tt> + <p>Reurns the value of the environment variable with the name varname, + if no such environment variable exists, zero is returned.</p> + </text> +  + <group><note/><text> + <p>This function is provided by master.c + </p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='hash' homogen-type='method'> + <method name='hash'/><doc placeholder='true'> + <text> + <p><tt>hash</tt> - hash a string</p> +  + <tt><p>int hash(string <i>s</i>);<br/> + or<br/> + int hash(string <i>s</i>, int <i>max</i>);<br/> + </p> + </tt> + <p>This function will return an int derived from the string s. The same + string will always hash to the same value. If a second argument + is given, the result will be &gt;= 0 and lesser than that argument. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='implode' homogen-type='method'> + <method name='implode'/><doc placeholder='true'> + <text> + <p><tt>implode</tt> - implode an array of strings</p> +  + <tt><p>string implode(string *<i>a</i>, string <i>delimeter</i>);<br/> + or<br/> + a * delimeter<br/> + </p> + </tt> + <p>This function is the inverse of explode. It contatenates all the + strings in a with a delimeter in between each. If no delimeter is + given, an empty string will be used.</p> + </text> +  + <group><example/><text> + <tt><p>&gt; implode( ({ "foo","bar","gazonk"}), "-" );<br/> + Result: foo-bar-gazonk<br/> + &gt; implode( ({ "f","o","o" }) );<br/> + Result: foo<br/> + &gt; ({ "a","b","c" })*" and ";<br/> + Result: a and b and c<br/> + &gt; <br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::explode' to='explode'>explode</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='indices' homogen-type='method'> + <method name='indices'/><doc placeholder='true'> + <text> + <p><tt>indices</tt> - return an array of all index possible for a value</p> +  + <tt><p>mixed *indices(string|array|mapping|list <i>foo</i>);<br/> + </p> + </tt> + <p>Indices returns an array of all values you can use as index when + indexing foo. For strings and arrays this is simply an array of the + ascending numbers. For mappings and lists, the array may contain any + kind of value.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::values' to='values'>values</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='int' homogen-type='method'> + <method name='int'/><doc placeholder='true'> + <text> + <p><tt>int</tt> - integers numbers</p> +  + <tt><p>9797 /* decimal number */<br/> + 0x20 /* hexadecimal number */<br/> + </p> + </tt> + <p>This type stores an integer, normally it is 32 bits and use 4 bytes + of storage when used in a global variable. + </p> + <p>A list of operators that applies to ints follows: + </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> +  + <group><seealso/><text> + <p><ref resolved='predef::float' to='float'>float</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='intp' homogen-type='method'> + <method name='intp'/><doc placeholder='true'> + <text> + <p><tt>intp</tt> - is the argument an int?</p> +  + <tt><p>array intp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is an int, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='l_sizeof' homogen-type='method'> + <method name='l_sizeof'/><doc placeholder='true'> + <text> + <p><tt>l_sizeof</tt> - Return the size of a list</p> +  + <tt><p>int l_sizeof(list <i>m</i>);<br/> + </p> + </tt> + <p>This function is equal to builtin/sizeof.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='list' homogen-type='method'> + <method name='list'/><doc placeholder='true'> + <text> + <p><tt>list</tt> - a set of values</p> +  + <tt><p>(&lt; 1, 7, 8, 9 &gt;)<br/> + </p> + </tt> + <p>A list is basically a mapping without data values, when indexing a + list 1 willl be returned if the index is present, zero otherwise. + </p> + <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 1<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> + </matrix> + <dl><group><text>present.<br/> + </text></group></dl></p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='listp' homogen-type='method'> + <method name='listp'/><doc placeholder='true'> + <text> + <p><tt>listp</tt> - is the argument an list?</p> +  + <tt><p>int listp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is a list, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='log' homogen-type='method'> + <method name='log'/><doc placeholder='true'> + <text> + <p><tt>log</tt> - Natural logarithm</p> +  + <tt><p>float log(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the natural logarithm of f. + exp( log(x) ) == x for x &gt; 0.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='lower_case' homogen-type='method'> + <method name='lower_case'/><doc placeholder='true'> + <text> + <p><tt>lower_case</tt> - convert a string to lower case</p> +  + <tt><p>string lower_case(string <i>s</i>);<br/> + </p> + </tt> + <p>Return a string with all capital letters converted to lower case.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::upper_case' to='upper_case'>upper_case</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='m_delete' homogen-type='method'> + <method name='m_delete'/><doc placeholder='true'> + <text> + <p><tt>m_delete</tt> - remove an index from a mapping</p> +  + <tt><p>mapping m_delete(mapping <i>map</i>, mixed <i>index</i>);<br/> + </p> + </tt> + <p>Remove the entry with index 'index' from mapping 'map' destructively. + Return the changed mapping. If the mapping does not have an + entry with index 'index', nothing is done. + Note that m_delete changes map destructively and only returns + the mapping for compatibility reasons.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::mappingp' to='mappingp'>mappingp</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='m_indices' homogen-type='method'> + <method name='m_indices'/><doc placeholder='true'> + <text> + <p><tt>m_indices</tt> - return all indices from a mapping</p> +  + <tt><p>mixed *m_indices(mapping <i>m</i>);<br/> + </p> + </tt> + <p>This function is equal to builtin/indices</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::indices' to='predef::indices'>builtin/indices</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='m_sizeof' homogen-type='method'> + <method name='m_sizeof'/><doc placeholder='true'> + <text> + <p><tt>m_sizeof</tt> - Return the size of a mapping</p> +  + <tt><p>int m_sizeof(mapping <i>m</i>);<br/> + </p> + </tt> + <p>This function is equal to builtin/sizeof.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='m_values' homogen-type='method'> + <method name='m_values'/><doc placeholder='true'> + <text> + <p><tt>m_values</tt> - return all values from a mapping</p> +  + <tt><p>mixed *m_values(mapping <i>m</i>);<br/> + </p> + </tt> + <p>This function is equal to builtin/values</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::values' to='predef::values'>builtin/values</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='map_array' homogen-type='method'> + <method name='map_array'/><doc placeholder='true'> + <text> + <p><tt>map_array</tt> - map an array over a function</p> +  + <tt><p>mixed *map_array(mixed *<i>arr</i>,function <i>fun</i>,mixed ... <i>args</i>);<br/> + or<br/> + mixed *map_array(object *<i>arr</i>,string <i>fun</i>,mixed ... <i>args</i>);<br/> + or<br/> + mixed *map_array(function *<i>arr</i>,-<i>1</i>,mixed ... <i>arg</i>);<br/> + </p> + </tt> + <p>First syntax: + Map array returns an array holding the items of arr mapped thrugh + the function fun. ie. arr[x]=fun(arr[x], @args) for all x. + </p> + <p>Second syntax: + Map array calls function fun in all objects in the array arr. + ie. arr[x]=arr[x]-&gt;fun(@ args); + </p> + <p>Third syntax: + Map array calls the functions in the array arr: + arr[x]=arr[x]-&gt;fun(@ args);</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='mapping' homogen-type='method'> + <method name='mapping'/><doc placeholder='true'> + <text> + <p><tt>mapping</tt> - an associative array</p> +  + <tt><p>([ index1:data1, index2:data2 ])<br/> + </p> + </tt> + <p>A mapping is basically an array that can be indexed on any type, not + not just integers. It can also be seen as a way of linking data + (usaully strings) together. It consists of a lot of index-data pairs + which are linked togeter in such a way that map[index1] returns data1. + It is also possible to set that data by writing map[index1]=new_data1. + If you try to set an index in a mapping that isn't already present in + the mapping then it will be added. + </p> + <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> + </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.<br/> + a != b : returns 1 if a is the same mapping as b, same size, indices<br/> + and values is not enough.<br/> + ! a : boolean not, returns 1<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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='mappingp' homogen-type='method'> + <method name='mappingp'/><doc placeholder='true'> + <text> + <p><tt>mappingp</tt> - is the argument an mapping?</p> +  + <tt><p>int mappingp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is a mapping, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='master' homogen-type='method'> + <method name='master'/><doc placeholder='true'> + <text> + <p><tt>master</tt> - return the master object</p> +  + <tt><p>object master();<br/> + </p> + </tt> + <p>Master is added by the master object to make it easier to access it. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='member_array' homogen-type='method'> + <method name='member_array'/><doc placeholder='true'> + <text> + <p><tt>member_array</tt> - find first occurance of a value in an array</p> +  + <tt><p>int member_array(mixed <i>item</i>, mixed *<i>arr</i>);<br/> + </p> + </tt> + <p>Returns the index of the first occurence of item in array arr. + If not found, then -1 is returned. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='mkdir' homogen-type='method'> + <method name='mkdir'/><doc placeholder='true'> + <text> + <p><tt>mkdir</tt> - make directory</p> +  + <tt><p>int mkdir(string <i>dirname</i>);<br/> + </p> + </tt> + <p>Create a directory, return zero if it fails and nonzero if it fails.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='mkmapping' homogen-type='method'> + <method name='mkmapping'/><doc placeholder='true'> + <text> + <p><tt>mkmapping</tt> - make a mapping from two arrays</p> +  + <tt><p>mapping mkmapping(mixed *<i>ind</i>, mixed *<i>val</i>);<br/> + </p> + </tt> + <p>Makes a mapping ind[x]:val[x], 0&lt;=x&lt;sizeof(ind). + Ind and val must have the same size. + This is the inverse operation of indices and values.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::indices' to='indices'>indices</ref> and <ref resolved='predef::values' to='values'>values</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='mv' homogen-type='method'> + <method name='mv'/><doc placeholder='true'> + <text> + <p><tt>mv</tt> - move a file (may handle directiories as well)</p> +  + <tt><p>int mv(string <i>from</i>,string <i>to</i>);<br/> + </p> + </tt> + <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> +  + <group><seealso/><text> + <p><ref resolved='predef::rm' to='predef::rm'>files/rm</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='next_object' homogen-type='method'> + <method name='next_object'/><doc placeholder='true'> + <text> + <p><tt>next_object</tt> - get next object</p> +  + <tt><p>object next_object(object <i>o</i>);<br/> + or<br/> + object next_object();<br/> + </p> + </tt> + <p>All objects are stored in a linked list, next_object() returns the + first object in this list, and next_object(o) the next object in the + list after o.</p> + </text> +  + <group><example/><text> + <tt><p>/* This example calls shutting_down() in all cloned objects */<br/> + object o;<br/> + for(o=next_object();o;o=next_object(o))<br/> + <dl><group><text>o-&gt;shutting_down();<br/> + </text></group></dl></p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::clone' to='clone'>clone</ref> and <ref resolved='predef::destruct' to='destruct'>destruct</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='object' homogen-type='method'> + <method name='object'/><doc placeholder='true'> + <text> + <p><tt>object</tt> - an instance of a class (program)</p> +  + <p>There is no syntax example in this file because there is no way to + write constant object. The only way to make new objects is to use + clone() on a program. + </p> + <p>Here follows a list of operators that applies to objects: + 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> + </matrix> + </p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='object_program' homogen-type='method'> + <method name='object_program'/><doc placeholder='true'> + <text> + <p><tt>object_program</tt> - get the program asociated with the object</p> +  + <tt><p>program object_program(object <i>o</i>);<br/> + </p> + </tt> + <p>This function returns the program from which o was cloned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::clone' to='clone'>clone</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='objectp' homogen-type='method'> + <method name='objectp'/><doc placeholder='true'> + <text> + <p><tt>objectp</tt> - is the argument an object?</p> +  + <tt><p>int objectp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is an object, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='perror' homogen-type='method'> + <method name='perror'/><doc placeholder='true'> + <text> + <p><tt>perror</tt> - print error</p> +  + <tt><p>void perror(string <i>s</i>);<br/> + </p> + </tt> + <p>Print a message to stderr. Stderr is normally the console, even if + the process output has been redirected to a file or pipe. + </p> + <p> + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='popen' homogen-type='method'> + <method name='popen'/><doc placeholder='true'> + <text> + <p><tt>popen</tt> - pipe open</p> +  + <tt><p>string popen(string <i>cmd</i>);<br/> + </p> + </tt> + <p>This function runs the command cmd as in a shell and returns the output. + See your unix/C manual for details on popen. + </p> + <p/> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='pow' homogen-type='method'> + <method name='pow'/><doc placeholder='true'> + <text> + <p><tt>pow</tt> - Raise a number to the power of another.</p> +  + <tt><p>float exp(float <i>n</i>, float <i>x</i>);<br/> + </p> + </tt> + <p>Return n raised to the power of x.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='previous_object' homogen-type='method'> + <method name='previous_object'/><doc placeholder='true'> + <text> + <p><tt>previous_object</tt> - return the calling object</p> +  + <tt><p>object previous_object();<br/> + </p> + </tt> + <p>Returns an object pointer to the object that called current function, + if any.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::call_function' to='predef::call_function'>builtin/call_function</ref> and <ref resolved='predef::backtrace' to='predef::backtrace'>builtin/backtrace</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='program' homogen-type='method'> + <method name='program'/><doc placeholder='true'> + <text> + <p><tt>program</tt> - a class, or blueprint for an object</p> +  + <p>There is no syntax example in this file because there is no way to + write constant programs. (yet) New programs are made with + 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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='programp' homogen-type='method'> + <method name='programp'/><doc placeholder='true'> + <text> + <p><tt>programp</tt> - is the argument an program?</p> +  + <tt><p>int programp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is a program, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='query_host_name' homogen-type='method'> + <method name='query_host_name'/><doc placeholder='true'> + <text> + <p><tt>query_host_name</tt> - return the name of the host we are running on</p> +  + <tt><p>string query_host_name();<br/> + </p> + </tt> + <p>This function returns the name of the machine the interpreter is + running on. This is the same thing that the command 'hostname' + prints. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='query_num_arg' homogen-type='method'> + <method name='query_num_arg'/><doc placeholder='true'> + <text> + <p><tt>query_num_arg</tt> - find out how many arguments were given</p> +  + <tt><p>int query_num_arg();<br/> + </p> + </tt> + <p>Query_num_arg returns the number of arguments given when this + function was called. This is only useful for varargs functions.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::call_function' to='call_function'>call_function</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='random' homogen-type='method'> + <method name='random'/><doc placeholder='true'> + <text> + <p><tt>random</tt> - return a random number</p> +  + <tt><p>int random(int <i>max</i>);<br/> + </p> + </tt> + <p>This function returns a random number in the range 0 - max-1. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='read_bytes' homogen-type='method'> + <method name='read_bytes'/><doc placeholder='true'> + <text> + <p><tt>read_bytes</tt> - read a number of bytes into a string from a file</p> +  + <tt><p>string read_bytes(string <i>file</i>,int <i>start</i>,int <i>len</i>);<br/> + </p> + </tt> + <p>Read len number of bytes from file file staring at byte start and + return it as a string.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::write_file' to='write_file'>write_file</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='regexp' homogen-type='method'> + <method name='regexp'/><doc placeholder='true'> + <text> + <p><tt>regexp</tt> - filter an array through a regexp</p> +  + <tt><p>string *regexp(string *<i>arr</i>, string <i>reg</i>);<br/> + </p> + </tt> + <p>Return those strings in arr that matches the regexp in reg.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::regexp' to='regexp/regexp'>regexp/regexp</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='regexpp' homogen-type='method'> + <method name='regexpp'/><doc placeholder='true'> + <text> + <p><tt>regexpp</tt> - is the argument an regexp?</p> +  + <tt><p>int regexpp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is a regexp, zero otherwise.</p> + </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 resolved='predef::programp' to='programp'>programp</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> + </docgroup> + <docgroup homogen-name='remove_call_out' homogen-type='method'> + <method name='remove_call_out'/><doc placeholder='true'> + <text> + <p><tt>remove_call_out</tt> - remove a call out from the call out queue</p> +  + <tt><p>int remove_call_out(function <i>f</i>);<br/> + </p> + </tt> + <p>This function finds the first call to the function f in the call + out queue and removes it. The time left to that call out will be + returned. If no call out was found, zero_type(remove_call_out(f)) + will return 1.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::call_out_info' to='call_out_info'>call_out_info</ref>, <ref resolved='predef::call_out' to='call_out'>call_out</ref> and <ref resolved='predef::find_call_out' to='find_call_out'>find_call_out</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='replace' homogen-type='method'> + <method name='replace'/><doc placeholder='true'> + <text> + <p><tt>replace</tt> - generic replace function</p> +  + <tt><p>string replace(string <i>s</i>, string <i>from</i>, string <i>to</i>);<br/> + or<br/> + string replace(string <i>s</i>, string *<i>from</i>, string *<i>to</i>);<br/> + or<br/> + array replace(array <i>a</i>, mixed <i>from</i>, mixed <i>to</i>);<br/> + or<br/> + mapping replace(mapping <i>a</i>, mixed <i>from</i>, mixed <i>to</i>);<br/> + </p> + </tt> + <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/> + 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/> + 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/> + a are searched for values equal to from, which are replaced by<br/> + to destructively.<br/> + </text></group></dl><br/> + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='reverse' homogen-type='method'> + <method name='reverse'/><doc placeholder='true'> + <text> + <p><tt>reverse</tt> - reverse a string, array or int</p> +  + <tt><p>string reverse(string <i>s</i>);<br/> + or<br/> + array reverse(arary <i>a</i>);<br/> + or<br/> + int reverse(int <i>i</i>);<br/> + </p> + </tt> + <p>This function reverseses a string, char by char, an array, value + by value or an int, bit by bit and returns the result. Reversing + strings can be particularly useful for parsing difficult syntaxes + which require scanning backwards.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::sscanf' to='sscanf'>sscanf</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='rm' homogen-type='method'> + <method name='rm'/><doc placeholder='true'> + <text> + <p><tt>rm</tt> - remove file or directory</p> +  + <tt><p>int rm(string <i>f</i>);<br/> + </p> + </tt> + <p>Remove a file or directory, return 0 if it fails. Nonzero otherwise.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::mkdir' to='predef::mkdir'>files/mkdir</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='rusage' homogen-type='method'> + <method name='rusage'/><doc placeholder='true'> + <text> + <p><tt>rusage</tt> - return resource usage</p> +  + <tt><p>int *rusage();<br/> + </p> + </tt> + <p>This function returns an array of ints describing how much resources + the intepreter process has used so far. This array will have at least + 29 elements, of which those values not available on this system will + be zero. The elements are as follows: + </p> + <p>0: user time + 1: system time + 2: maxrss + 3: idrss + 4: isrss + 5: minflt + 6: minor pagefaults + 7: major pagefaults + 8: swaps + 9: block input op. + 10: block output op. + 11: messages sent + 12: messages received + 13: signals received + 14: voluntary context switches + 15: involuntary context switches + 16: sysc + 17: ioch + 18: rtime + 19: ttime + 20: tftime + 21: dftime + 22: kftime + 23: ltime + 24: slptime + 25: wtime + 26: stoptime + 27: brksize + 28: stksize + </p> + <p>Don't ask me to explain these values, read your system manuals for + more information. (Note that all values may not be present though)</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::time' to='time'>time</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='search' homogen-type='method'> + <method name='search'/><doc placeholder='true'> + <text> + <p><tt>search</tt> - search for a value in a string or array</p> +  + <tt><p>int search(string <i>haystack</i>, string <i>needle</i>, [ int <i>start</i> ]);<br/> + or<br/> + int search(mixed *<i>haystack</i>, mixed <i>needle</i>, [ int <i>start</i> ]);<br/> + or<br/> + mixed search(mapping <i>haystack</i>, mixed <i>needle</i>, [ mixed <i>start</i> ]);<br/> + </p> + </tt> + <p>Search for needle in haystack. Return the position of needle in + haystack or -1 if not found. If the optional argument start is present + search is started at this position. Note that when haystack is a string + needle must be a string, and the first occurance of this string is + returned. However, when haystack is an array, needle is compared only + to one value at a time in haystack. + </p> + <p>When the haystack is a mapping, search tries to find the index + connected to the data needle. That is, it tries to lookup the mapping + backwards. If needle isn't present in the mapping, zero is returned, + and zero_type() will return 1 for this zero.</p> + </text> +  + <group><note/><text> + <p>This function replaces strstr and member_array from LPC4.</p> + </text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::indices' to='indices'>indices</ref>, <ref resolved='predef::values' to='values'>values</ref> and <ref resolved='predef::zero_type' to='zero_type'>zero_type</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='search_array' homogen-type='method'> + <method name='search_array'/><doc placeholder='true'> + <text> + <p><tt>search_array</tt> - search for something in an array</p> +  + <tt><p>int search_array(mixed *<i>arr</i>,function <i>fun</i>,mixed <i>arg</i>, ...);<br/> + or<br/> + int search_array(object *<i>arr</i>,string <i>fun</i>,mixed <i>arg</i>, ...);<br/> + or<br/> + int search_array(function *<i>arr</i>,-<i>1</i>,mixed <i>arg</i>, ...);<br/> + </p> + </tt> + <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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='sin' homogen-type='method'> + <method name='sin'/><doc placeholder='true'> + <text> + <p><tt>sin</tt> - Trigonometrical sine</p> +  + <tt><p>float sin(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the sinus value for f.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='sizeof' homogen-type='method'> + <method name='sizeof'/><doc placeholder='true'> + <text> + <p><tt>sizeof</tt> - return the size of an array, string, list or mapping</p> +  + <tt><p>int sizeof(string|list|mapping|array <i>a</i>);<br/> + </p> + </tt> + <p>This function returns the number of indexes available in the argument + given to it. It replaces older functions like strlen, m_sizeof and + size. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='sort_array' homogen-type='method'> + <method name='sort_array'/><doc placeholder='true'> + <text> + <p><tt>sort_array</tt> - sort an array</p> +  + <tt><p>mixed *sort_array(mixed *<i>arr</i>,function <i>fun</i>,mixed ... <i>args</i>);<br/> + </p> + </tt> + <p>The first syntax sorts an array after a compare-function fun + which takes two arguments and should return 1 if the first argument + 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> +  + <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> +  + </doc> + </docgroup> + <docgroup homogen-name='spawn' homogen-type='method'> + <method name='spawn'/><doc placeholder='true'> + <text> + <p><tt>spawn</tt> - spawn a process</p> +  + <tt><p>int spawn(string <i>cmd</i>);<br/> + or<br/> + int spawn(string <i>cmd</i>, object <i>stdin</i>);<br/> + or<br/> + int spawn(string <i>cmd</i>, object <i>stdin</i>, object <i>stdout</i>);<br/> + or<br/> + int spawn(string <i>cmd</i>, object <i>stdin</i>, object <i>stdout</i>, object <i>stderr</i>);<br/> + </p> + </tt> + <p>This function spawns a process but does not wait for it to finish. + Optionally, clones of /precompiled/file can be sent to it to + specify where stdin, stdout and stderr of the spawned processes + should go.</p> + </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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='sprintf' homogen-type='method'> + <method name='sprintf'/><doc placeholder='true'> + <text> + <p><tt>sprintf</tt> - print the result from sprintf</p> +  + <tt><p>string sprintf(string <i>format</i>,mixed <i>arg</i>,....);<br/> + <br/> + DESCRIPTION<br/> + The format string is a string containing a description of how to<br/> + output the data in the rest of the arguments. This string should<br/> + generally speaking have one %<i>modifyers</i><i>operator</i> (examples:<br/> + %s, %0d, %-=20s) for each of the rest arguments.<br/> +  + </p> + <p>Modifyers:<br/> + <dl><group><text>0 Zero pad numbers (implies right justification)<br/> + ! Toggle truncation<br/> + <dl><group><text>pad positive integers with a space<br/> + </text></group></dl>+ 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> + <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/> + %<i>modifyers</i>{format%} do a format for every index in an array.<br/> + </text></group></dl></p> + </tt></text> +  + <group><example/><text> + <tt><p>uLPC v1.0E-95 Running Hilfe v1.2 (Hubbe's Incremental LPC FrontEnd)<br/> + &gt; int screen_width=70;<br/> + Result: 70<br/> + &gt; mixed sample;<br/> + &gt; write(sprintf("fish: %c\n", 65));<br/> + fish: A<br/> + Result: 0<br/> + &gt; write(sprintf("Hello green friends\n"));<br/> + Hello green friends<br/> + Result: 0<br/> + &gt; write(sprintf("num: %d\n", 10));<br/> + num: 10<br/> + Result: 0<br/> + &gt; write(sprintf("num: %+10d\n", 10));<br/> + num: +10<br/> + Result: 0<br/> + &gt; write(sprintf("num: %010d\n", 5*2));<br/> + num: 0000000010<br/> + Result: 0<br/> + &gt; write(sprintf("num: %|10d\n", 20/2));<br/> + num: 10 <br/> + Result: 0<br/> + &gt; write(sprintf("%|*s\n",screen_width,"THE NOT END"));<br/> + <dl><group><text>THE NOT END <br/> + </text></group></dl>Result: 0<br/> + &gt; write(sprintf("%|=*s\n",screen_width, "fun with penguins\n"));<br/> + <dl><group><text>fun with penguins <br/> + </text></group></dl>Result: 0<br/> + &gt; write(sprintf("%-=*O\n",screen_width,({ "fish", 9, "gumbies", 2 })));<br/> + ({ /* 4 elements */ <br/> + <dl><group><text>"fish", <br/> + 9, <br/> + "gumbies", <br/> + 2 <br/> + </text></group></dl>}) <br/> + Result: 0<br/> + &gt; write(sprintf("%-=*s\n", screen_width,<br/> + <dl><group><text>"This will wordwrap the specified string within the "+<br/> + "specified field size, this is useful say, if you let "+<br/> + "users specify their screen size, then the room "+<br/> + "descriptions will automagically word-wrap as appropriate.\n"+<br/> + "slosh-n's will of course force a new-line when needed.\n"));<br/> + </text></group></dl>This will wordwrap the specified string within the specified field <br/> + size, this is useful say, if you let users specify their screen size, <br/> + then the room descriptions will automagically word-wrap as <br/> + appropriate. <br/> + slosh-n's will of course force a new-line when needed. <br/> + Result: 0<br/> + &gt; write(sprintf("%-=*s %-=*s\n", screen_width/2,<br/> + <dl><group><text>"Two columns next to each other (any number of columns will "+<br/> + "of course work) independantly word-wrapped, can be useful.",<br/> + screen_width/2-1,<br/> + "The - is to specify justification, this is in addherence "+<br/> + "to std sprintf which defaults to right-justification, "+<br/> + "this version also supports centre and right justification."));<br/> + </text></group></dl>Two columns next to each other (any The - is to specify justification,<br/> + number of columns will of course this is in addherence to std <br/> + work) independantly word-wrapped, sprintf which defaults to <br/> + can be useful. right-justification, this version <br/> + <dl><group><text>also supports centre and right <br/> + justification. <br/> + </text></group></dl>Result: 0<br/> + &gt; write(sprintf("%-$*s\n", screen_width,<br/> + <dl><group><text>"Given a\nlist of\nslosh-n\nseparated\n'words',\nthis option\n"+<br/> + "creates a\ntable out\nof them\nthe number of\ncolumns\n"+<br/> + "be forced\nby specifying a\npresision.\nThe most obvious\n"+<br/> + "use is for\nformatted\nls output."));<br/> + </text></group></dl>Given a list of slosh-n <br/> + separated 'words', this option <br/> + creates a table out of them <br/> + the number of columns be forced <br/> + by specifying a presision. The most obvious <br/> + use is for formatted ls output. <br/> + Result: 0<br/> + &gt; write(sprintf("%-#*s\n", screen_width,<br/> + <dl><group><text>"Given a\nlist of\nslosh-n\nseparated\n'words',\nthis option\n"+<br/> + "creates a\ntable out\nof them\nthe number of\ncolumns\n"+<br/> + "be forced\nby specifying a\npresision.\nThe most obvious\n"+<br/> + "use is for\nformatted\nls output."));<br/> + </text></group></dl>Given a creates a by specifying a <br/> + list of table out presision. <br/> + slosh-n of them The most obvious <br/> + separated the number of use is for <br/> + 'words', columns formatted <br/> + this option be forced ls output. <br/> + Result: 0<br/> + &gt; sample = ({ "first column: bing", "second column: womble" });<br/> + Result: ({ /* 2 elements */<br/> + <dl><group><text>"first column: bing",<br/> + "second column: womble"<br/> + </text></group></dl>})<br/> + &gt; write(sprintf("%-=*s\n%-=@*s\n", screen_width,<br/> + <dl><group><text>"Another bizarre option is the @ operator, it applies the "+<br/> + "format string it is in to each element of the array:",<br/> + screen_width/sizeof(sample),<br/> + sample));<br/> + </text></group></dl>Another bizarre option is the @ operator, it applies the format string<br/> + it is in to each element of the array: <br/> + first column: bing second column: womble <br/> + Result: 0<br/> + &gt; write(sprintf("Better use these instead: %{gurksallad: %s\n%}\n",<br/> + <dl><group><text>sample));<br/> + </text></group></dl>Better use these instead: gurksallad: first column: bing<br/> + gurksallad: second column: womble<br/> + <br/> + Result: 0<br/> + &gt; write(sprintf("Of course all the simple printf options "+<br/> + <dl><group><text>"are supported:\n %s: %d %x %o %c\n",<br/> + "65 as decimal, hex, octal and a char",<br/> + 65, 65, 65, 65));<br/> + </text></group></dl>Of course all the simple printf options are supported:<br/> + <dl><group><text>65 as decimal, hex, octal and a char: 65 41 101 A<br/> + </text></group></dl>Result: 0<br/> + &gt; write(sprintf("%|*s\n",screen_width, "THE END"));<br/> + <dl><group><text>THE END <br/> + </text></group></dl>Result: 0<br/> + &gt; quit<br/> + Exiting.<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::sscanf' to='sscanf'>sscanf</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='sqrt' homogen-type='method'> + <method name='sqrt'/><doc placeholder='true'> + <text> + <p><tt>sqrt</tt> - Square root</p> +  + <tt><p>float sqrt(float <i>f</i>);<br/> + or<br/> + int sqrt(int <i>i</i>);<br/> + </p> + </tt> + <p>Return the square root of f, or in the second case, the square root + truncated to the closest lower integer.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='sscanf' homogen-type='method'> + <method name='sscanf'/><doc placeholder='true'> + <text> + <p><tt>sscanf</tt> - scan a string using a format string</p> +  + <tt><p>int sscanf(string <i>str</i>, string <i>fmt</i>, mixed <i>var1</i>, mixed <i>var2</i> ...);<br/> + </p> + </tt> + <p>Parse a string str using the format fmt. fmt can contain strings + 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> + <p>If a * is put between the percent and the operator, the operator + will not only match it's argument, not assign any variables. + </p> + <p>Number of matched arguments is returned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::explode' to='explode'>explode</ref> and <ref resolved='predef::sprintf' to='sprintf'>sprintf</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='string' homogen-type='method'> + <method name='string'/><doc placeholder='true'> + <text> + <p><tt>string</tt> - a string of characters</p> +  + <tt><p>"foo"<br/> + </p> + </tt> + <p>This type can contain a string, or list of characters, strings can + contain any character, even null characters. Strings are a basic + type in LPC, as opposed to C where strings are represented by an + array of char. This means that you cannot set individual characters + in a string with the index operator for instance. In fact, there are + no functions that alters strings destructively. Also, all strings + are 'shared', that means that if the same string is used in several + places, only one will be stored in memory. + </p> + <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 "a" + a - b : subtraction ( same as replace(a,b,"") ) + a / b : division ( same thing as explode(a,b) ) + ! a : boolean not, returns 1 + </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> + </matrix> + </p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='stringp' homogen-type='method'> + <method name='stringp'/><doc placeholder='true'> + <text> + <p><tt>stringp</tt> - is the argument an string?</p> +  + <tt><p>int stringp(mixed <i>arg</i>);<br/> + </p> + </tt> + <p>Returns 1 if arg is a string, zero otherwise.</p> + </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 resolved='predef::regexpp' 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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='strlen' homogen-type='method'> + <method name='strlen'/><doc placeholder='true'> + <text> + <p><tt>strlen</tt> - Return the length of a string</p> +  + <tt><p>int strlen(string <i>s</i>);<br/> + </p> + </tt> + <p>This function is equal to builtin/sizeof.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::sizeof' to='predef::sizeof'>builtin/sizeof</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='strstr' homogen-type='method'> + <method name='strstr'/><doc placeholder='true'> + <text> + <p><tt>strstr</tt> - find a string inside a string</p> +  + <tt><p>int strstr(string <i>str1</i>,string <i>str2</i>);<br/> + </p> + </tt> + <p>Return the position of str2 in str1, if str2 can't be found in str1 + -1 is returned.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='sum' homogen-type='method'> + <method name='sum'/><doc placeholder='true'> + <text> + <p><tt>sum</tt> - add values together</p> +  + <tt><p>int sum(int ... <i>i</i>);<br/> + or<br/> + float sum(float ... <i>f</i>);<br/> + or<br/> + string sum(string|float|int ... <i>p</i>);<br/> + or<br/> + array sum(array ... <i>a</i>);<br/> + or<br/> + mapping sum(mapping ... <i>m</i>);<br/> + or<br/> + list sum(list ... <i>l</i>);<br/> + </p> + </tt> + <p>This function does exactly the same thing as adding all the arguments + together with +. It's just here so you can get a function-pointer to + the summation operator. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='sum_arrays' homogen-type='method'> + <method name='sum_arrays'/><doc placeholder='true'> + <text> + <p><tt>sum_arrays</tt> - map any number of arrays over a function.</p> +  + <tt><p>mixed *sum_arrays(function <i>fun</i>,mixed *<i>arr1</i>,...);<br/> + </p> + </tt> + <p>Works like this: + </p> + <p><dl><group><text>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/> + {<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> + </p> + <p>Simple ehh?</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='tan' homogen-type='method'> + <method name='tan'/><doc placeholder='true'> + <text> + <p><tt>tan</tt> - Trigonometrical tangent</p> +  + <tt><p>float tan(float <i>f</i>);<br/> + </p> + </tt> + <p>Return the tangent value for f.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='this_function' homogen-type='method'> + <method name='this_function'/><doc placeholder='true'> + <text> + <p><tt>this_function</tt> - return a functionpointer to the current function</p> +  + <tt><p>function this_function();<br/> + </p> + </tt> + <p>Returns a functionpointer to the current function, useful for + making recursive lambda-functions.</p> + </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> +  + </doc> + </docgroup> + <docgroup homogen-name='this_object' homogen-type='method'> + <method name='this_object'/><doc placeholder='true'> + <text> + <p><tt>this_object</tt> - return the object we are evaluating in currently</p> +  + <tt><p>object this_object();<br/> + </p> + </tt> + <p>This function returns the object we are curently evaluating in. + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='throw' homogen-type='method'> + <method name='throw'/><doc placeholder='true'> + <text> + <p><tt>throw</tt> - throw a value to catch or global error handling</p> +  + <tt><p>void throw(mixed <i>value</i>);<br/> + </p> + </tt> + <p>This function throws a value to a waiting catch. If no catch is + waiting global error handling will send the value to handle_error + in the master object. If you throw an array with where the first + index contains an error message and the second index is a backtrace, + (the output from backtrace() that is) then it will be treated exactly + like a real error by overlying functions.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::catch' to='catch'>catch</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='time' homogen-type='method'> + <method name='time'/><doc placeholder='true'> + <text> + <p><tt>time</tt> - return the current time</p> +  + <tt><p>int time();<br/> + or<br/> + int time(1);<br/> + </p> + </tt> + <p>This function returns the number of secons since 1 Jan 1970. + The function ctime() converts this integer to a readable string. + </p> + <p>The second syntax does not call the system call time() as often, + but is only updated in the backed. (when lpc code isn't running)</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::time' to='time'>time</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='trace' homogen-type='method'> + <method name='trace'/><doc placeholder='true'> + <text> + <p><tt>trace</tt> - change debug trace level</p> +  + <tt><p>int trace(int <i>t</i>);<br/> + </p> + </tt> + <p>This function affects the debug trace level. (also set by the -t + command line option) The old level is returned. Trace level 1 or + higher means that calls to lpc functions are printed to stderr, + level 2 or higer means calls to builtin functions are printed, 3 + means every opcode interpreted is printed, 4 means arguments to + these opcodes are printed as well. See the command lines options + for more information + </p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='upper_case' homogen-type='method'> + <method name='upper_case'/><doc placeholder='true'> + <text> + <p><tt>upper_case</tt> - convert a string to upper case</p> +  + <tt><p>string upper_case(string <i>s</i>);<br/> + </p> + </tt> + <p>Return a copy of the string s with all lower case character converted + to upper case character.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::lower_case' to='lower_case'>lower_case</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='values' homogen-type='method'> + <method name='values'/><doc placeholder='true'> + <text> + <p><tt>values</tt> - return an array of all possible values from indexing</p> +  + <tt><p>mixed *values(string|list|mapping|array <i>foo</i>);<br/> + </p> + </tt> + <p>Values return an array of all values you can get when indexing the + value foo. For strings, an array of int with the ascii values of the + characters in the string is returned. For a list, an array filled with + ones is return. For mappings and arrays, the returned array may + contain any kind of value.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::indices' to='indices'>indices</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='write' homogen-type='method'> + <method name='write'/><doc placeholder='true'> + <text> + <p><tt>write</tt> - write text to stdout</p> +  + <tt><p>int write(string <i>text</i>);<br/> + </p> + </tt> + <p>Added by the master, it directly calls write in a clone of + /precompiled/file</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::perror' to='predef::perror'>builtin/perror</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='write_file' homogen-type='method'> + <method name='write_file'/><doc placeholder='true'> + <text> + <p><tt>write_file</tt> - append a string to a file</p> +  + <tt><p>int write_file(string file, string str)<br/> + </p> + </tt> + <p>Append the string str onto the file file. Returns number of bytes written.</p> + </text> +  + <group><seealso/><text> + <p><ref to='read_file'>read_file</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='zero_type' homogen-type='method'> + <method name='zero_type'/><doc placeholder='true'> + <text> + <p><tt>zero_type</tt> - return the type of zero</p> +  + <tt><p>int zero_type(int <i>a</i>);<br/> + </p> + </tt> + <p>There are many types of zeros out there, or at least there are two. + One is returned by normal functions, and one returned by mapping + lookups and find_call_out() when what you looked for wasn't there. + The only way to separate these two kinds of zeros is zero_type. + When doing a find_call_out or mapping lookup, zero_type on this value + will return 1 if there was no such thing present in the mappping, or + no such call_out could be found. Otherwize zero_type will return zero.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::find_call_out' to='find_call_out'>find_call_out</ref></p> + </text></group> +  + </doc> + </docgroup> + <class name='/precompiled/file'> + <doc placeholder='true'> + <text> + <p><tt>/precompiled/file</tt> - the basic file handling program</p> +  + <p>/precompiled/file is a pre-compiled LPC program, written in C. + It contains the functions need to handle files, sockets, streams + and pipes from within lpc. /precompiled/file is a part of the files + module. + </p> + <p>Here follows the descriptions of the functions in /precompiled/file: + </p> + <p/> + </text> +  + </doc> + <docgroup homogen-name='assign' homogen-type='method'> + <method name='assign'> + </method> + <doc placeholder='true'> + <text> + <p><tt>assign</tt> - assign a file</p> +  + <tt><p>void file-&gt;assign(object <i>f</i>);<br/> + </p> + </tt> + <p>This function takes a clone of /precompiled/file and assigns all + variables this file from it. It can be used together with file-&gt;dup + to move files around.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.dup' to='file-&gt;dup'>file-&gt;dup</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='close' homogen-type='method'> + <method name='close'> + </method> + <doc placeholder='true'> + <text> + <p><tt>close</tt> - close file</p> +  + <tt><p>int file-&gt;close(string <i>how</i>);<br/> + or<br/> + int file-&gt;close();<br/> + </p> + </tt> + <p>Close the file. Optionally, specify "r", "w" or "rw" to close just + the read, just the write or both read and write part of the file + respectively. Note that this funciton will not call the + close_callback.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.close' to='file-&gt;close'>file-&gt;close</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='connect' homogen-type='method'> + <method name='connect'> + </method> + <doc placeholder='true'> + <text> + <p><tt>connect</tt> - connect a socket to something.</p> +  + <tt><p>int file-&gt;connect(string <i>ip</i>,int <i>port</i>);<br/> + </p> + </tt> + <p>This funcion connects a socket previously created with + file-&gt;open_socket to a remote socket. The argument is the ip number + for the remote machine on the form x.x.x.x where x is a number. + This function returns 1 for success, 0 otherwise. Note that if the + socket is in nonblocking mode, you have to wait for a write or close + callback before you know if the connection failed or not.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.query_address' to='file-&gt;query_address'>file-&gt;query_address</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> + </method> + <doc placeholder='true'> + <text> + <p><tt>create</tt> - init file struct</p> +  + <tt><p>object clone((program)"/precompiled/<i>file</i>");<br/> + or<br/> + object clone((program)"/precompiled/<i>file</i>",string <i>fd</i>);<br/> + </p> + </tt> + <p>When cloning a file, you can specify that you want to clone + stdin, stdout or stderr, by giving "stdin", "stdou" or "stderr" to + clone as a second argument. If no second argument is given, + an unitialized file will be cloned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::clone' to='predef::clone'>builtin/clone</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='dup' homogen-type='method'> + <method name='dup'> + </method> + <doc placeholder='true'> + <text> + <p><tt>dup</tt> - duplicate a file</p> +  + <tt><p>object file-&gt;dup();<br/> + </p> + </tt> + <p>This function returns a clone of /precompiled/file with all variables + copied from this file. Note that all variables, even id, is copied.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.assign' to='file-&gt;assign'>file-&gt;assign</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='dup2' homogen-type='method'> + <method name='dup2'> + </method> + <doc placeholder='true'> + <text> + <p><tt>dup2</tt> - duplicate a file over another</p> +  + <tt><p>int file-&gt;dup2(object <i>o</i>);<br/> + </p> + </tt> + <p>This function works similar to file-&gt;assign, but instead of making + the argument a reference to the same file, it creates a new file + with the same properties and places it in the argument.</p> + </text> +  + <group><example/><text> + <tt><p>/* Redirect stdin to come from the file 'foo' */<br/> + object o;<br/> + o=clone((program)"/precompiled/file");<br/> + o-&gt;open("foo","r");<br/> + o-&gt;dup2(clone((program)"/precompiled/file","stdin"));<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.assign' to='file-&gt;assign'>file-&gt;assign</ref> and <ref resolved='predef::/precompiled/file.dup' to='file-&gt;dup'>file-&gt;dup</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='errno' homogen-type='method'> + <method name='errno'> + </method> + <doc placeholder='true'> + <text> + <p><tt>errno</tt> - what was last error?</p> +  + <tt><p>int file-&gt;errno();<br/> + </p> + </tt> + <p>Return the error code for the last command on this file. + Error code is normally cleared when a command is successful. + </p> + <p/> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='open' homogen-type='method'> + <method name='open'> + </method> + <doc placeholder='true'> + <text> + <p><tt>open</tt> - open a file</p> +  + <tt><p>int file-&gt;open(string <i>filename</i>, string <i>how</i>);<br/> + </p> + </tt> + <p>Open a file for read write or append. The variable how should + 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> + </matrix> +  + </p> + <p>How should _always_ contain at least one of 'r' or 'w'.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.close' to='file-&gt;close'>file-&gt;close</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='open_socket' homogen-type='method'> + <method name='open_socket'> + </method> + <doc placeholder='true'> + <text> + <p><tt>open_socket</tt> - open a socket</p> +  + <tt><p>int file-&gt;open_socket();<br/> + </p> + </tt> + <p>This makes this file into a socket ready for connection. The reason + for this function is so that you can set the socket to nonblocking + or blocking (default is blocking) before you call file-&gt;connect() + This function returns 1 for success, 0 otherwise.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.connect' to='file-&gt;connect'>file-&gt;connect</ref> and <ref resolved='predef::/precompiled/file.set_nonblocking' to='file-&gt;set_nonblocking'>file-&gt;set_nonblocking</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='query_address' homogen-type='method'> + <method name='query_address'> + </method> + <doc placeholder='true'> + <text> + <p><tt>query_address</tt> - get adresses</p> +  + <tt><p>string file-&gt;query_address();<br/> + or<br/> + string file-&gt;query_address(1);<br/> + </p> + </tt> + <p>This function returns the remote or local address of a socket on the + form "x.x.x.x port". Without argument, the remot address is returned, + with argument the local address is returned. If this file is not a + socket, not connected or some other error occurs, zero is returned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.connect' to='file-&gt;connect'>file-&gt;connect</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='query_close_callback' homogen-type='method'> + <method name='query_close_callback'> + </method> + <doc placeholder='true'> + <text> + <p><tt>query_close_callback</tt> - return the close callback function</p> +  + <tt><p>function file-&gt;query_close_callback();<br/> + </p> + </tt> + <p>This function returns the close_callback, which is set with + file-&gt;set_nonblocking.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.set_nonblocking' to='file-&gt;set_nonblocking'>file-&gt;set_nonblocking</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='query_id' homogen-type='method'> + <method name='query_id'> + </method> + <doc placeholder='true'> + <text> + <p><tt>query_id</tt> - get id of this file</p> +  + <tt><p>mixed file-&gt;query_id();<br/> + </p> + </tt> + <p>This function returns the id of this file.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.set_id' to='file-&gt;set_id'>file-&gt;set_id</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='query_read_callback' homogen-type='method'> + <method name='query_read_callback'> + </method> + <doc placeholder='true'> + <text> + <p><tt>query_read_callback</tt> - return the read callback function</p> +  + <tt><p>function file-&gt;query_read_callback();<br/> + </p> + </tt> + <p>This function returns the read_callback, which is set with + file-&gt;set_nonblocking.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.set_nonblocking' to='file-&gt;set_nonblocking'>file-&gt;set_nonblocking</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='query_write_callback' homogen-type='method'> + <method name='query_write_callback'> + </method> + <doc placeholder='true'> + <text> + <p><tt>query_write_callback</tt> - return the write callback function</p> +  + <tt><p>function file-&gt;query_write_callback();<br/> + </p> + </tt> + <p>This function returns the write_callback, which is set with + file-&gt;set_nonblocking.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.set_nonblocking' to='file-&gt;set_nonblocking'>file-&gt;set_nonblocking</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='read' homogen-type='method'> + <method name='read'> + </method> + <doc placeholder='true'> + <text> + <p><tt>read</tt> - read data from a file or stream</p> +  + <tt><p>string file-&gt;read(int <i>nbytes</i>);<br/> + </p> + </tt> + <p>Read tries to read nbytes bytes from the file, and return it as a + string. If something goes wrong, zero is returned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.write' to='file-&gt;write'>file-&gt;write</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='seek' homogen-type='method'> + <method name='seek'> + </method> + <doc placeholder='true'> + <text> + <p><tt>seek</tt> - seek to a position in a file</p> +  + <tt><p>int file-&gt;seek(int <i>pos</i>);<br/> + </p> + </tt> + <p>Seek to a position in a file, if pos is less than zero, seek to + position pos relative end of file. Return -1 for failiure, or + the old position in the file when successful.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.tell' to='file-&gt;tell'>file-&gt;tell</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='set_blocking' homogen-type='method'> + <method name='set_blocking'> + </method> + <doc placeholder='true'> + <text> + <p><tt>set_blocking</tt> - make stream blocking</p> +  + <tt><p>void file-&gt;set_blocking();<br/> + </p> + </tt> + <p>This function sets a stream to blocking mode. ie. all reads and writes + will wait until data has been written before returning.</p> + </text> +  + <group><seealso/><text> + <p><ref to='predef::set_nonblocking'>files/set_nonblocking</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='set_buffer' homogen-type='method'> + <method name='set_buffer'> + </method> + <doc placeholder='true'> + <text> + <p><tt>set_buffer</tt> - set internal socket buffer</p> +  + <tt><p>void file-&gt;set_buffer(int <i>bufsize</i>, string <i>mode</i>);<br/> + or<br/> + void file-&gt;set_buffer(int <i>bufsize</i>);<br/> + </p> + </tt> + <p>This function sets the internal buffer size of a socket or stream, + the second argument allows you to set the read or write buffer by + specifying "r" or "w". It is not guaranteed that this function + actually does anything, but it certainly helps to increase data + transfer speed when it does.</p> + </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> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='set_id' homogen-type='method'> + <method name='set_id'> + </method> + <doc placeholder='true'> + <text> + <p><tt>set_id</tt> - set id of this file</p> +  + <tt><p>void file-&gt;set_id(mixed <i>id</i>);<br/> + </p> + </tt> + <p>This function sets the id of this file. The id is mainly used as an + identifier that is sent as the first arguments to all callbacks. The + default id is this_object(). Another possible use of the id is to hold + all data related to this file in a mapping or array.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.query_id' to='file-&gt;query_id'>file-&gt;query_id</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='set_nonblocking' homogen-type='method'> + <method name='set_nonblocking'> + </method> + <doc placeholder='true'> + <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>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. + When the stream has buffer space over for writing, write_callback is + called so you can write more data to it. If the stream is closed at + the other end, close_callback is called. All callbacks will have the + id of file as first argument when called.</p> + </text> +  + <group><seealso/><text> + <p><ref to='predef::set_blocking'>files/set_blocking</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='stat' homogen-type='method'> + <method name='stat'> + </method> + <doc placeholder='true'> + <text> + <p><tt>stat</tt> - do file_stat on an open file</p> +  + <tt><p>int *file-&gt;stat();<br/> + </p> + </tt> + <p>This function returns the same information as the efun file_stat, + but for the file it is called in. If file is not an open file, + zero will be returned. Zero is also returned if file is a pipe or + socket.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::file_stat' to='file_stat'>file_stat</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='tell' homogen-type='method'> + <method name='tell'> + </method> + <doc placeholder='true'> + <text> + <p><tt>tell</tt> - tell where we are in a file</p> +  + <tt><p>int file-&gt;tell();<br/> + </p> + </tt> + <p>Return the current position in the file.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.seek' to='file-&gt;seek'>file-&gt;seek</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='write' homogen-type='method'> + <method name='write'> + </method> + <doc placeholder='true'> + <text> + <p><tt>write</tt> - write data to a file or stream</p> +  + <tt><p>int file-&gt;write(string <i>data</i>);<br/> + </p> + </tt> + <p>Write data to file or stream and return how many bytes that was + actually written. -1 is returned if something went wrong and no + bytes had been written.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.read' to='file-&gt;read'>file-&gt;read</ref></p> + </text></group> +  + </doc> + </docgroup> + </class> + <class name='/precompiled/port'> + <doc placeholder='true'> + <text> + <p><tt>/precompiled/port</tt> - a program for handling and listening to open ports</p> +  + <p>/precompiled/port is a precompiled program that handles listening to + sockets. Whenever you need a bound socket that is open and listens + for connections you should use this program. + </p> + <p>Here follows the diescriptionsof the functions in /precompiled/port: + </p> + <p/> + </text> +  + </doc> + <docgroup homogen-name='accept' homogen-type='method'> + <method name='accept'> + </method> + <doc placeholder='true'> + <text> + <p><tt>accept</tt> - accept a connection</p> +  + <tt><p>object port-&gt;accept();<br/> + </p> + </tt> + <p>This function completes a connection made from a remote machine to + this port. It returns a two-way stream in the form of a copy of + /precompiled/file. The new file is by default set to blocking.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file' to='file'>file</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='bind' homogen-type='method'> + <method name='bind'> + </method> + <doc placeholder='true'> + <text> + <p><tt>bind</tt> - open socket and bind it to a port</p> +  + <tt><p>int port-&gt;bind(int <i>port</i>);<br/> + or<br/> + int port-&gt;bind(int <i>port</i>,function <i>accept_callback</i>);<br/> + </p> + </tt> + <p>Bind opens a sockets and binds it to port number on the local machine. + If the second argument is present, the socket is set to nonblocking + and the callback funcition is called whenever something connects to + the socket. The callback will receive the id for this port as argument. + Bind returns 1 on success, and zero on failiure.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/port.accept' to='port-&gt;accept'>port-&gt;accept</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> + </method> + <doc placeholder='true'> + <text> + <p><tt>create</tt> - create and/or setup a port</p> +  + <tt><p>void port-&gt;create("stdin")<br/> + or<br/> + void port-&gt;create("stdin",function accept_callback)<br/> + or<br/> + void port-&gt;create(int port)<br/> + or<br/> + void port-&gt;create(int port,function accept_callback)<br/> + </p> + </tt> + <p>When create is called with 'stdin' as argument, a socket is created + out of the file descriptor 0, this is only useful if that actually + IS a socket to begin with. When create is called with an int as first + argument, it does the same as bind() would do with the same arguments.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::clone' to='predef::clone'>builtin/clone</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='errno' homogen-type='method'> + <method name='errno'> + </method> + <doc placeholder='true'> + <text> + <p><tt>errno</tt> - return the last error</p> +  + <tt><p>int port-&gt;errno();<br/> + </p> + </tt> + <p>If the last call done on this port failed, errno will return an + integer describing what went wrong. Refer to your unix manual for + further information.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/file.errno' to='file-&gt;errno'>file-&gt;errno</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='listen_fd' homogen-type='method'> + <method name='listen_fd'> + </method> + <doc placeholder='true'> + <text> + <p><tt>listen_fd</tt> - listen to an already open port</p> +  + <tt><p>int port-&gt;listen_fd(int <i>fd</i>);<br/> + or<br/> + int port-&gt;listen_fd(int <i>fd</i>,function <i>accept_callback</i>);<br/> + </p> + </tt> + <p>This function does the same as port-&gt;bind, except that instead + of creating a new socket and bind it to a port, it expects that + the filedescriptor 'fd' is an alread open port.</p> + </text> +  + <group><note/><text> + <p>This function is only for the advanced user, and is generally used + when sockets are passed to uLPC at exec time.</p> + </text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/port.bind' to='port-&gt;bind'>port-&gt;bind</ref> and <ref resolved='predef::/precompiled/port.accept' to='port-&gt;accept'>port-&gt;accept</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='query_id' homogen-type='method'> + <method name='query_id'> + </method> + <doc placeholder='true'> + <text> + <p><tt>query_id</tt> - Return the id for this port.</p> +  + <tt><p>mixed port-&gt;query_id();<br/> + </p> + </tt> + <p>This function returns the id for this port. The id is normally the + first argument to accept_callback.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/port.set_id' to='port-&gt;set_id'>port-&gt;set_id</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='set_id' homogen-type='method'> + <method name='set_id'> + </method> + <doc placeholder='true'> + <text> + <p><tt>set_id</tt> - set the id of a port</p> +  + <tt><p>void port-&gt;set_id(mixed <i>id</i>);<br/> + </p> + </tt> + <p>This function sets the id used for accept_callback by this port. + The default id is this_object().</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::/precompiled/port.query_id' to='port-&gt;query_id'>port-&gt;query_id</ref></p> + </text></group> +  + </doc> + </docgroup> + </class> + <class name='/precompiled/regexp'> + <doc placeholder='true'> + <text> + <p><tt>/precompiled/regexp</tt> - regexp handling module</p> +  + <p>/precompiled/regexp is a precompiled LPC program that interfaces a + regexp package written in C. It contains a few simple functions to + handle regexps. For more documentation about regexps, consult your + unix manual for 'ed' or 'sed'. + </p> + <p>Descriptions of all functions in /precompiled/file follows: + </p> + <p/> + </text> +  + </doc> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> + </method> + <doc placeholder='true'> + <text> + <p><tt>create</tt> - compile regexp</p> +  + <tt><p>void create();<br/> + or<br/> + void create(string <i>regexp</i>);<br/> + or<br/> + object clone((program)"/precompiled/<i>file</i>");<br/> + or<br/> + object clone((program)"/precompiled/<i>file</i>",string <i>regexp</i>);<br/> + </p> + </tt> + <p>When create is called, the current regexp bound to this object is + cleared. If a string is sent to create(), this string will be compiled + to an internal representation of the regexp and bound to this object + for laters calls to match or split. Calling create() without an + argument can be used to free up a little memory after the regexp has + been used.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::clone' to='predef::clone'>builtin/clone</ref> and <ref to='regexp-&gt;match'>regexp-&gt;match</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='match' homogen-type='method'> + <method name='match'> + </method> + <doc placeholder='true'> + <text> + <p><tt>match</tt> - match a regexp</p> +  + <tt><p>int regexp-&gt;match(string s)<br/> + </p> + </tt> + <p>Return 1 if s matches the regexp bound to the object regexp, + zero otherwise</p> + </text> +  + <group><seealso/><text> + <p><ref to='regexp-&gt;create'>regexp-&gt;create</ref> and <ref to='regexp-&gt;split'>regexp-&gt;split</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='split' homogen-type='method'> + <method name='split'> + </method> + <doc placeholder='true'> + <text> + <p><tt>split</tt> - split a string according to a pattern</p> +  + <tt><p>string *regexp-&gt;split(string s)<br/> + </p> + </tt> + <p>Works as regexp-&gt;match, but returns an array of the strings that + matched the subregexps.</p> + </text> +  + <group><seealso/><text> + <p><ref to='regexp-&gt;create'>regexp-&gt;create</ref> and <ref to='regexp-&gt;split'>regexp-&gt;split</ref></p> + </text></group> +  + </doc> + </docgroup> + </class> + </namespace> + </autodoc>   Newline at end of file added.