Branch: Tag:

1995-11-05

1995-11-05 23:39:29 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

tests ulpc and doc dir, moved from bin/

Rev: src/test/.cvsignore:1.1
Rev: src/test/create_testsuite:1.1
Rev: src/test/test_lpc.lpc:1.1
Rev: src/test/verifymanual.lpc:1.1

134:      </doc>   </docgroup> - <docgroup homogen-name='aggregate' homogen-type='method'> - <method name='aggregate'/><doc placeholder='true'> + <docgroup homogen-name='aggregate_list' homogen-type='method'> + <method name='aggregate_list'/><doc placeholder='true'>   <text> - <p><tt>aggregate</tt> - construct a list</p> + <p><tt>aggregate_list</tt> - construct a list</p>      <tt><p>list aggregate_list(mixed ... <i>elems</i>);<br/>   or<br/>
151:   </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> + <p><ref resolved='predef::sizeof' to='sizeof'>sizeof</ref>, <ref resolved='predef::listp' to='listp'>listp</ref> and <ref resolved='predef::mklist' to='mklist'>mklist</ref></p>   </text></group>      </doc>
186:   </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> + efuns, and with the value of the efun as argument.</p>   </text>    -  + <group><seealso/><text> + <p><ref resolved='predef::add_efun' to='add_efun'>add_efun</ref></p> + </text></group> +    </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><tt>allocate</tt> - allocate an array</p>    -  + <tt><p>mixed *allocate(int <i>size</i>, [ string <i>type</i> ]);<br/> + </p> + </tt>   <p>Allocate an array of size elements. Optionally, write what type you   want to store in the array in the second argument as a string.   Note that the type given in this string should be simple, instead
239:   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>Arrays are basically a place to store a number of other values. + Arrays in lpc are allocated blocks of values. They are dynamically + allocated and does not need to be declared as in C. The values in + the array can be set when creating the array as in the first + construction or anytime afterwards like this: arr[index]=data where + index is an integer greater or equal to 0 and smaller than the array + size. Note that arrays are shared and use reference counts to keep + track of their references. This will have the effect that you can + have two variables pointing to the same array, and when you change + an index in in it, both variables will show the change.   </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:
258:   <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> a &amp; b : intersection, return an array with all values that are </c></r>   <r><c> </c><c> present in both a and b </c></r> - <r><c> </c></r> + <r><c> a | b : union, return an array with all values that are present in </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/>
274:   </text></group></dl>a != b : returns 0 if a is the same array as b, same size and values<br/>   <dl><group><text>is not enough.<br/>   </text></group></dl>! a : boolean not, returns 0<br/> - </text></group></dl>a[c] : indexing, returns element c in the array (c is an int)<br/> + a[c] : indexing, returns element c in the array (c is an int)<br/>   a[c]=d : setting, sets element c in the array to d (c is an int)<br/>   a[c..d]: range (c &amp; d are ints) returns an array containing a pice of<br/>   <dl><group><text>the array a. The piece starts at element c and ends (and<br/>
440:   <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><tt>capitalize</tt> - capitalize a string</p>    -  + <tt><p>string capitalize(string str)<br/> + </p> + </tt>   <p>Convert the first character in str to upper case, and return the   new string.</p>   </text>
473:      </doc>   </docgroup> + <docgroup homogen-name='catch' homogen-type='method'> + <method name='catch'/><doc placeholder='true'> + <text> + <p><tt>catch</tt> - catch errorrs</p> +  + <tt><p>catch { commands }<br/> + or<br/> + catch ( expression )<br/> + </p> + </tt> + <p>catch traps exceptions such as run time errors or calls to throw() and + returns the argument given to throw. For a run time error, this value + is ({ "error message", backtrace }) </p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::throw' to='predef::throw'>builtin/throw</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='cd' homogen-type='method'>   <method name='cd'/><doc placeholder='true'>   <text>
709:      </doc>   </docgroup> - <docgroup homogen-name='describe_bactrace' homogen-type='method'> - <method name='describe_bactrace'/><doc placeholder='true'> + <docgroup homogen-name='describe_backtrace' homogen-type='method'> + <method name='describe_backtrace'/><doc placeholder='true'>   <text> - <p><tt>describe_bactrace</tt> - make a backtrace readable</p> + <p><tt>describe_backtrace</tt> - make a backtrace readable</p>      <tt><p>string describe_backtrace(mixed **<i>backtrace</i>);<br/>   </p>
780:   <docgroup homogen-name='exec' homogen-type='method'>   <method name='exec'/><doc placeholder='true'>   <text> - <p><tt>exec</tt> - execute a program</p> + <p><tt>exec</tt> - simple way to use exece()</p>    - <tt><p>int exec(string ... <i>args</i>);<br/> + <tt><p>int exec(string <i>file</i>, 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> + <p>This function destroys the uLPC parser and runs the program + 'file' instead with the arguments. If no there are no '/' in + the filename, the variable PATH will be consulted when looking + for the program. This function does not return except when + the exec fails for some reason.</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/> + <tt><p>exec("/bin/echo","hello","world");<br/> + <br/>   </p>   </tt></text></group>    - <group><seealso/><text> - <p><ref resolved='predef::fork' to='predef::fork'>files/fork</ref> and <ref resolved='predef::/precompiled/file.pipe' to='file-&gt;pipe'>file-&gt;pipe</ref></p> - </text></group> -  +    </doc>   </docgroup> - <docgroup homogen-name='exec' homogen-type='method'> - <method name='exec'/><doc placeholder='true'> + <docgroup homogen-name='exece' homogen-type='method'> + <method name='exece'/><doc placeholder='true'>   <text> - <p><tt>exec</tt> - simple way to use exece()</p> + <p><tt>exece</tt> - execute a program</p>    - <tt><p>int exec(string <i>file</i>, string ... <i>args</i>);<br/> + <tt><p>int exece(string <i>file</i>, string *<i>args</i>);<br/> + or<br/> + int exece(string <i>file</i>, string *<i>args</i>, mapping(string:string) <i>env</i>);<br/>   </p>   </tt> - <p>This function destroys the uLPC parser and runs the program - 'file' instead with the arguments. If no there are no '/' in - the filename, the variable PATH will be consulted when looking - for the program. This function does not return except when - the exec fails for some reason.</p> + <p>This function transforms the uLPC process into a process running + the program specified in the argument 'file' with the argument 'args'. + If the mapping 'env' is present, it will completely replace all + environment variables before the new program is executed. + This function only returns if something went wrong during exece(), + 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("/bin/echo","hello","world");<br/> - <br/> + <tt><p>exece("/bin/ls", ({"-l"}));<br/> + exece("/bin/sh", ({"-c", "echo $HOME"}), (["HOME":"/not/home"]));<br/>   </p>   </tt></text></group>    -  + <group><seealso/><text> + <p><ref resolved='predef::fork' to='predef::fork'>files/fork</ref> and <ref resolved='predef::/precompiled/file.pipe' to='file-&gt;pipe'>file-&gt;pipe</ref></p> + </text></group> +    </doc>   </docgroup>   <docgroup homogen-name='exit' homogen-type='method'>
939:   <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/> + * -3 for links,<br/>   * -4 for otherwise<br/>   */<br/> - </text></group></dl></text></group></dl>atime, /* last access time */<br/> + </text></group></dl>atime, /* last access time */<br/>   mtime, /* last modify time */<br/>   ctime, /* last status time change */<br/>   uid, /* The user who owns this file */<br/>
1290:      </doc>   </docgroup> + <docgroup homogen-name='hilfe' homogen-type='method'> + <method name='hilfe'/><doc placeholder='true'> + <text> + <p><tt>hilfe</tt> - Hubbe's Incremental LPC FrontEnd</p> +  + <tt><p>$ hilfe<br/> + or<br/> + $ ulpc -Cstay hilfe<br/> + </p> + </tt> + <p>Hilfe is a LPC-script that supplies an incremental environment for + LPC. It allowes you to evaluate LPC 'on the fly'. If you're running + UNIX, you only have to write 'hilfe' to start it, otherwise you will + have to write 'driver -Cstay hilfe' to run it. If you don't know what + 'incremeantal' means in this context, ask you local LISP junkie. + </p> + <p>Hilfe has the following commands: + </p> + <p>quit - exit hilfe + new - clear all variables and function definition + dump - dump all current variables + . - clear input buffer + </p> + <p>Hilfe parses a subset of LPC, there many things it doesn't handle. Here + is a list of what you can do: + </p> + <p>Define a function: + &lt;type&gt; &lt;name&gt;( &lt;arguments&gt; ) { &lt;statements &gt; } + Note that hilfe simulates a function defenition by defining a variable + and setting it to the function pointer. Therefor actual typechecking is + almost nil. Also note that hilfe doesn't recognize type modifiers such + as static, private, varargs etc. + </p> + <p>Declare one or many global variables: + &lt;type&gt; &lt;name&gt; [=&lt;value&gt;], &lt;name&gt; [=value&gt;] ..... ; + Hilfe simulates variable handling, and typechecking is almost nil, + therefor all global variables are declared as mixed, whatever the + &lt;type&gt; may be. + </p> + <p><matrix> + <r><c> Evaluate a statement: </c></r> + <r><c> &lt;statement&gt; ; </c></r> + <r><c> Statements include the following examples: </c></r> + <r><c> </c><c> for(e=0;e&lt;10;e++) ; e=10; </c></r> + </matrix> +  + </p> + <p><matrix> + <r><c> </c><c> write(e); </c></r> + <r><c> </c></r> + </matrix> +  + </p> + <p><matrix> + <r><c> </c><c> if(foo) return bar; else return gazonk; </c></r> + <r><c> </c></r> + </matrix> +  + </p> + <p>Statements beginning with for, while, switch, if, do or return will + not automatically return anything, and no result will be printed.</p> + </text> +  + <group><seealso/><text> + <p><ref to='script_mode'>script_mode</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='implode' homogen-type='method'>   <method name='implode'/><doc placeholder='true'>   <text>
1785:      </doc>   </docgroup> + <docgroup homogen-name='mklist' homogen-type='method'> + <method name='mklist'/><doc placeholder='true'> + <text> + <p><tt>mklist</tt> - make a list</p> +  + <tt><p>list mklist(mixed *a)<br/> + </p> + </tt> + <p>This function creates a list from an array.</p> + </text> +  + <group><example/><text> + <tt><p>&gt; mklist( ({1,2,3}) );<br/> + Result: (&lt; /* 3 elements */<br/> + <dl><group><text>1,<br/> + 2,<br/> + 3<br/> + </text></group></dl>&gt;)<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::aggregate_list' to='predef::aggregate_list'>builtin/aggregate_list</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='mkmapping' homogen-type='method'>   <method name='mkmapping'/><doc placeholder='true'>   <text>
2062:   <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>This function returns a random number in the range 0 - max-1.</p> + </text> +  + <group><seealso/><text> + <p><ref resolved='predef::random_seed' to='random_seed'>random_seed</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='random_seed' homogen-type='method'> + <method name='random_seed'/><doc placeholder='true'> + <text> + <p><tt>random_seed</tt> - seed random generator</p> +  + <tt><p>void random_seed(int <i>seed</i>);<br/>   </p> -  + </tt> + <p>This function sets the initial value for the random generator.</p>   </text>    -  + <group><example/><text> + <tt><p>uLPC v1.0E-13 Running Hilfe v1.2 (Hubbe's Incremental LPC FrontEnd)<br/> + &gt; random_seed(17);<br/> + Result: 0<br/> + &gt; random(1000);<br/> + Result: 732<br/> + &gt; random(1000);<br/> + Result: 178<br/> + &gt; random(1000);<br/> + Result: 94<br/> + &gt; random_seed(17);<br/> + Result: 0<br/> + &gt; random(1000);<br/> + Result: 732<br/> + &gt; random(1000);<br/> + Result: 178<br/> + &gt; random(1000);<br/> + Result: 94<br/> + &gt;<br/> + </p> + </tt></text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::random' to='random'>random</ref></p> + </text></group> +    </doc>   </docgroup>   <docgroup homogen-name='read_bytes' homogen-type='method'>
3052:      </doc>   </docgroup> + <docgroup homogen-name='version' homogen-type='method'> + <method name='version'/><doc placeholder='true'> + <text> + <p><tt>version</tt> - return version info</p> +  + <tt><p>string version();<br/> + </p> + </tt> + <p>This function returns a brief information about the uLPC version.</p> + </text> +  + <group><example/><text> + <tt><p>&gt; version();<br/> + Result: uLPC v1.0E-13<br/> + <br/> + </p> + </tt></text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='write' homogen-type='method'>   <method name='write'/><doc placeholder='true'>   <text>
3307:   </matrix>      </p> - <p>How should _always_ contain at least one of 'r' or 'w'.</p> + <p>How should _always_ contain at least one of 'r' or 'w'. + </p> + <p>Returns 1 on success, 0 otherwise.</p>   </text>      <group><seealso/><text>
3565:   </text>      <group><seealso/><text> - <p><ref to='predef::exece'>builtin/exece</ref></p> + <p><ref resolved='predef::exece' to='predef::exece'>builtin/exece</ref></p>   </text></group>      </doc>
3582:   </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> + default id is 0. 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>