Branch: Tag:

1996-06-21

1996-06-21 18:34:42 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

document for call_out module

Rev: src/modules/call_out/doc/call_out:1.1
Rev: src/modules/call_out/doc/call_out_info:1.1
Rev: src/modules/call_out/doc/find_call_out:1.1
Rev: src/modules/call_out/doc/remove_call_out:1.1

268:      </doc>   </docgroup> + <docgroup homogen-name='_verify_internals' homogen-type='method'> + <method name='_verify_internals'/><doc placeholder='true'> + <text> + <p><tt>_verify_internals</tt> - check uLPC internals</p> +  + <tt><p>void _verify_internals();<br/> + </p> + </tt> + <p>This function goes through most of the internal uLPC structures and + generates a fatal error if one of them is found to be out of order. + It is only used for debugging.</p> +  + debugging</text> +  + </doc> + </docgroup>   <docgroup homogen-name='`!' homogen-type='method'>   <method name='`!'/><doc placeholder='true'>   <text>
2388:      </doc>   </docgroup> + <docgroup homogen-name='glob' homogen-type='method'> + <method name='glob'/><doc placeholder='true'> + <text> + <p><tt>glob</tt> - match strings against globs</p> +  + <tt><p>int glob(string <i>glob</i>, string <i>str</i>);<br/> + or<br/> + string *glob(string <i>glob</i>, string *<i>arr</i>);<br/> + </p> + </tt> + <p>This function matches "globs". A in the glob string a question sign + matches any character and an asterisk matches any string. When + given two strings as argument a true/false value is returned + which reflects if the 'str' matches 'glob'. When given an array as + second argument, an array containing all matching strings is returned.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::sscanf' to='sscanf'>sscanf</ref> and <ref resolved='predef::regexp' to='regexp'>regexp</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='hash' homogen-type='method'>   <method name='hash'/><doc placeholder='true'>   <text>
2846:      </doc>   </docgroup> + <docgroup homogen-name='localtime' homogen-type='method'> + <method name='localtime'/><doc placeholder='true'> + <text> + <p><tt>localtime</tt> - break down time() into intelligible components</p> +  + <tt><p>mapping(string:int) localtime(int <i>time</i>);<br/> + </p> + </tt> + <p>Given a time represented as second since 1970, as returned by the + function time(), this function returns a mapping with the following + components: + </p> + <p><matrix> + <r><c> sec </c><c> seconds over the minute </c><c> 0 - 59 </c></r> + <r><c> min </c><c> minutes over the hour </c><c> 0 - 59 </c></r> + <r><c> hour </c><c> what hour in the day </c><c> 0 - 23 </c></r> + <r><c> mday </c><c> day of the month </c><c> 1 - 31 </c></r> + <r><c> mon </c><c> what month </c><c> 0 - 11 </c></r> + <r><c> year </c><c> years since 1900 </c><c> 0 - </c></r> + <r><c> wday </c><c> day of week (0=sunday) </c><c> 0 - 6 </c></r> + <r><c> yday </c><c> day of year </c><c> 0 - 365 </c></r> + <r><c> isdst </c><c> is daylight saving time </c><c> 0/1 </c></r> + <r><c> timezone </c><c> differance between </c></r> + <r><c> </c><c> </c><c> local time and UTC </c></r> + </matrix> + </p> + </text> +  + <group><note/><text> + <p>The 'timezone' might not be available on all platforms.</p> + </text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::time' to='time'>time</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='log' homogen-type='method'>   <method name='log'/><doc placeholder='true'>   <text>
3306:      </doc>   </docgroup> + <docgroup homogen-name='operators' homogen-type='method'> + <method name='operators'/><doc placeholder='true'> + <text> + <p><tt>operators</tt> - arethmics and other stuff</p> +  + <p>uLPC has the following operators: + </p> + <p><matrix> + <r><c> a(args) </c><c> function call </c></r> + <r><c> a[b..c] </c><c> range </c></r> + <r><c> a[b] </c><c> index </c></r> + <r><c> --a </c><c> pre decrement </c></r> + <r><c> a-- </c><c> post decrement </c></r> + <r><c> ++a </c><c> pre increment </c></r> + <r><c> a++ </c><c> post increment </c></r> + <r><c> (type)a </c><c> cast </c></r> + <r><c> ~a </c><c> complement </c></r> + <r><c> !a </c><c> not </c></r> + <r><c> -a </c><c> negate </c></r> + <r><c> a/b </c><c> divide </c></r> + <r><c> a%b </c><c> modulo </c></r> + <r><c> a*b </c><c> multiply </c></r> + <r><c> a-b </c><c> subtract </c></r> + <r><c> a+b </c><c> add </c></r> + <r><c> &gt;&gt; </c><c> shift right </c></r> + <r><c> &lt;&lt; </c><c> shift left </c></r> + <r><c> a&gt;b </c><c> greater than? </c></r> + <r><c> a&lt;b </c><c> lesser than? </c></r> + <r><c> a&gt;=b </c><c> greater or equal than? </c></r> + <r><c> a&lt;=b </c><c> lesser or equal than? </c></r> + <r><c> a!=b </c><c> not equal to? </c></r> + <r><c> a==b </c><c> equal to? </c></r> + <r><c> a&amp;b </c><c> intersection </c></r> + <r><c> a^b </c><c> xor (symmetric differance) </c></r> + <r><c> a|b </c><c> union </c></r> + <r><c> a&amp;&amp;b </c><c> logical and </c></r> + <r><c> a||b </c><c> logical or </c></r> + <r><c> a?b:c </c><c> condition </c></r> + <r><c> a=b </c><c> assignment </c></r> + </matrix> +  + </p> + <p>The ones at the top of the list are parsed before operators lower + down on the list. This means that a|b&amp;c means a|(b&amp;c) not (a|b)&amp;c. + Look at the individual pages for fuller explanations of what they do. + </p> + <p>Then there is also the @ "splice" operator which can only be used in + argument lists. + </p> + <p>Arguments to operators are always computed from left to right. + </p> + <p>Many (but not all) of these operators can also be used as by prepending + with a ` sign. For instance `+(a,b) is the same as a+b. These functions + are called "operator functions" and the following are currently + available: + </p> + <p>`== `!= `! `&lt; `&lt;= `&gt; `&gt;= `+ `- `&amp; `| `^ `&lt;&lt; `&gt;&gt; `* `/ `% `~ + </p> + <p>These operator functions are basically efuns, but beware, if you + re-define the `+ function a+b will also be redefined. + </p> + <p>On top of all this, many operators can also be overloaded. Overloading + an operator lets you specify how operators works on your objects. + To overload an operator you simply put the corresponding operator + function as a method in your object. An example: + </p> + <p>&gt; program nine=class {<br/> + <dl><group><text>int `+(int arg) { return arg+9; }<br/> + </text></group></dl>};<br/> + Result: program<br/> + &gt; clone(nine)+1;<br/> + Result: 10<br/> + &gt;<br/> +  + </p> + <p>This little example defines a program that works almost like the number + nine. As you can see, clone(nine)+1 is the same as clone(nine)-&gt;`+(1) + in this case, and that is the whole point of operator overloading. + Note however that it would not have worked to write 1+clone(nine) + because operator overloading only works if the first argument is the + object with the overloaded function. Well, almost anyway, the operators + &lt;, &gt;, &lt;=, &gt;= can check both sides. In fact, the methods `&lt;= and `&gt;= + will never be called since uLPC will translate a&lt;=b to !(a&gt;b). + </p> + <p>These are the operators you can overload: + </p> + <p><matrix> + <r><c> `== </c><c> also overloads `!= </c></r> + <r><c> `! </c><c> This is also used by if-statements to find out if the object in question is 'true' or not. </c></r> + <r><c> `&lt; </c><c> also overloads `&gt;= </c></r> + <r><c> `&gt; </c><c> also overloads `&lt;= </c></r> + <r><c> `+ </c><c> </c></r> + <r><c> `- </c><c> </c></r> + <r><c> `&amp; </c><c> </c></r> + <r><c> `| </c><c> </c></r> + <r><c> `^ </c><c> </c></r> + <r><c> `&lt;&lt; </c><c> </c></r> + <r><c> `&gt;&gt; </c><c> </c></r> + <r><c> `* </c><c> </c></r> + <r><c> `/ </c><c> </c></r> + <r><c> `% </c><c> </c></r> + <r><c> `~ </c><c> </c></r> + </matrix> +  + </p> + <p>If you also define a function __hash to return an integer, which + must be equal for all objects where `== is true you can index mappings + on the contents of your objects rather than on the object itself. + More details about this will come later.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::operators' to='/precompiled/mpz'>/precompiled/mpz</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='perror' homogen-type='method'>   <method name='perror'/><doc placeholder='true'>   <text>
3418:      </doc>   </docgroup> + <docgroup homogen-name='putenv' homogen-type='method'> + <method name='putenv'/><doc placeholder='true'> + <text> + <p><tt>putenv</tt> - put environment variable</p> +  + <tt><p>void putenv(string <i>varname</i>, string <i>value</i>);<br/> + </p> + </tt> + <p>This function sets the environment variable 'varname' to 'value'.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::getenv' to='getenv'>getenv</ref> and <ref resolved='predef::exece' to='exece'>exece</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='query_host_name' homogen-type='method'>   <method name='query_host_name'/><doc placeholder='true'>   <text>