a1c5881995-08-09Fredrik Hübinette (Hubbe) <?xml version='1.0' encoding='utf-8'?> <autodoc>
0bf0ef2000-09-25Fredrik Hübinette (Hubbe) <namespace name='7.0'> <module name='Calendar'> <doc> <text> <p> This module implements calendar calculations, and base classes for time units. </p> </text> </doc> <module name='Gregorian'> <doc> <text> <p>time units: <ref resolved='7.0::Calendar.Gregorian.Year'>Year</ref>, <ref>Month</ref>, <ref>Week</ref>, <ref>Day</ref> </p> </text> </doc> <docgroup homogen-name='datetime' homogen-type='method'> <method name='datetime'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Replacement for localtime. </p> </text> </doc> </docgroup> <docgroup homogen-name='datetime_name' homogen-type='method'> <method name='datetime_name'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Replacement for ctime. </p> </text> </doc> </docgroup> <docgroup homogen-name='datetime_short_name' homogen-type='method'> <method name='datetime_short_name'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Replacement for ctime. </p> </text> </doc> </docgroup> <class name='Year'> <doc> <text> <p>A <ref resolved='7.0::Calendar.time_unit'>Calendar.time_unit</ref>.</p> <p>Lesser units: <ref>Month</ref>, <ref>Week</ref>, <ref>Day</ref> Greater units: none</p> <p/> </text> </doc> <docgroup homogen-name='parse' homogen-type='method'> <method name='parse'> <returntype> <object>object </object></returntype> <arguments><argument name='fmt'><type><string/></type></argument> <argument name='arg'><type><string/></type></argument> </arguments> </method><doc> <text> <p>parse a date, create relevant object fmt is in the format "abc%xdef..." where abc and def is matched, and %x is one of those time units: %Y absolute year %y year (70-99 is 1970-1999, 0-69 is 2000-2069) %M month (number, name or short name) (needs %y) %W week (needs %y) %D date (needs %y, %m) %a day (needs %y) %e weekday (needs %y, %w) %h hour (needs %d, %D or %W) %m minute (needs %h) %s second (needs %s) </p> </text> </doc> </docgroup> </class> </module> <module name='Stardate'> <doc> <text> <p>time unit: TNGDate</p> </text> </doc> <class name='TNGDate'> <doc> <text> <p>implements ST:TNG stardates can be used as create argument to Day</p> </text> </doc> </class> </module> <class name='time_unit'> <docgroup homogen-type='method'> <method name='next'> <returntype> <object>object </object></returntype> <arguments> </arguments> </method><method name='prev'> <returntype> <object>object </object></returntype> <arguments> </arguments> </method><method name='`+'> <returntype> <object>object </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='`-'> <returntype> <object>object </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='`-'> <returntype> <object>object </object></returntype> <arguments><argument name='x'><type><object resolved='7.0::Calendar.time_unit.next'/></type></argument> </arguments> </method><doc> <text> <p>next and prev gives the logical next and previous object. The <tt>+</tt> operator gives that logical relative object, ie <tt>my_day+14</tt> gives 14 days ahead. <tt>-</tt> works the same way, but can also take an object of the same type and give the difference as an integer.</p> </text> </doc> </docgroup> <docgroup homogen-name='greater' homogen-type='method'> <method name='greater'> <returntype> <array><valuetype><string/></valuetype></array></returntype> <arguments> </arguments> </method><doc> <text> <p>Gives a list of methods to get greater (longer) time units from this object. For a month, this gives back <tt>({"year"})</tt>, thus the method <tt>month-&gt;year()</tt> gives the year object. </p> </text> </doc> </docgroup> <docgroup homogen-name='lesser' homogen-type='method'> <method name='lesser'> <returntype> <array><valuetype><string/></valuetype></array></returntype> <arguments> </arguments> </method><doc> <text> <p>Gives a list of methods to get lesser (shorter) time units. ie, for a month, this gives back <tt>({"day"})</tt> and the method <tt>day(mixed n)</tt> gives back that day object. The method <tt>days()</tt> gives back a list of possible argument values to the method <tt>day</tt>. Concurrently, <tt>Array.map(o-&gt;days(),o-&gt;day)</tt> gives a list of day objects in the object <tt>o</tt>.</p> <p> Ie:<pre> array(string) lesser() - gives back a list of possible xxx's. object xxxs() - gives back a list of possible n's. object xxx(mixed n) - gives back xxx n object xxx(object(Xxx) o) - gives back the corresponing xxx </pre></p> <p>The list of n's (as returned from xxxs) are always in order.</p> <p>There are two n's with special meaning, 0 and -1. 0 always gives the first xxx, equal to my_obj-&gt;xxx(my_obj-&gt;xxxs()[0]), and -1 gives the last, equal to my_obj-&gt;xxx(my_obj-&gt;xxxs()[-1]).</p> <p>To get all xxxs in the object, do something like <tt>Array.map(my_obj-&gt;xxxs(),my_obj-&gt;xxx)</tt>.</p> <p>xxx(object) may return zero, if there was no correspondning xxx. </p> </text> </doc> </docgroup> </class> </module> </namespace>
431c431998-12-31Fredrik Hübinette (Hubbe) <namespace name='predef'>
5803a92021-04-06Tobias S. Josefowitz <docgroup homogen-name='TOKENIZE_KEEP_ESCAPES' homogen-type='constant'><doc><text><p>Don't unquote backslash-sequences in quoted strings during tokenizing. This is used for bug-compatibility with Microsoft...</p> </text><group><seealso/><text><p><ref>tokenize()</ref>, <ref>tokenize_labled()</ref></p> </text></group></doc> <constant name='TOKENIZE_KEEP_ESCAPES'/> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='_do_call_outs' homogen-type='method'> <method name='_do_call_outs'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>_do_call_outs</tt> - do all pending call_outs.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void _do_call_out();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><dl><group><text>This function runs all pending call_outs that should have been<br/> run if pike returned to the backend. It should not be used in<br/> normal operation.<br/> </text></group></dl> </p> <p>As a side-effect, this function sets the value returned by time(1) to the current time.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text> <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>, <ref resolved='predef::call_out_info' to='call_out_info'>call_out_info</ref> and <ref to='time'>time</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='acos' homogen-type='method'> <method name='acos'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>acos</tt> - Trigonometrical inverse cosine</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float acos(float <i>f</i>);<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the arcus cosinus value for f.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::cos' to='predef::cos'>math/cos</ref> and <ref resolved='predef::asin' to='predef::asin'>math/asin</ref></p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='asin' homogen-type='method'> <method name='asin'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>asin</tt> - Trigonometrical inverse sine</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float asin(float <i>f</i>);<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the arcus sinus value for f.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::sin' to='predef::sin'>math/sin</ref> and <ref resolved='predef::acos' to='predef::acos'>math/acos</ref></p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='atan' homogen-type='method'> <method name='atan'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>atan</tt> - Trigonometrical inverse tangent</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float atan(float <i>f</i>);<br/> </p> </tt> <p>Return the arcus tangent value for f.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group>
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='call_out' homogen-type='method'> <method name='call_out'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>call_out</tt> - make a delayed call to a function</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>mixed call_out(function <i>f</i>, int <i>delay</i>, mixed ... <i>args</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Call_out places a call to the function f with the argument args in a queue to be called in about delay seconds. The return value identifies this call out. The return value can be sent to find_call_out or remove_call_out to remove the call out again.</p> </text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='call_out_info' homogen-type='method'> <method name='call_out_info'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>call_out_info</tt> - get info about all call outs</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>mixed **call_out_info();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <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><matrix> <r><c> time_left, </c><c> /* an int */ </c></r> <r><c> caller, </c><c> /* the object that made the call out */ </c></r> <r><c> function, </c><c> /* the function to be called */ </c></r> <r><c> arg1, </c><c> /* the first argument, if any */ </c></r> <r><c> arg2, </c><c> /* the second argument, if any */ </c></r> <r><c> ... </c><c> /* and so on... */ </c></r> </matrix> </text></group></dl>})<br/> </p> </text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='cd' homogen-type='method'> <method name='cd'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>cd</tt> - change directory</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int cd(string <i>s</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Change the current directory for the whole Pike process, return 1 for success, 0 otherwise.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::getcwd' to='predef::getcwd'>files/getcwd</ref></p>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='ceil' homogen-type='method'> <method name='ceil'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>ceil</tt> - Truncate a number upward</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float ceil(float <i>f</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the closest integral value higher or equal to x. Note that ceil() does _not_ return an int, merely an integral value.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::floor' to='predef::floor'>math/floor</ref></p>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='chroot' homogen-type='method'> <method name='chroot'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>chroot</tt> - change the root directory</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int chroot(string <i>newroot</i>);<br/> or<br/> int chroot(object(File) <i>obj</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Changes the root directory for this process to the indicated directory.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text> <group><note/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Since this function modifies the directory structure as seen from Pike, you have to modify the environment variables PIKE_MODULE_PATH and PIKE_INCLUDE_PATH to compensate for the new root-directory.
6130721996-11-01Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function only exists on systems that have the chroot(2) system call. The second variant only works on systems that also have the fchroot(2) system call.
6130721996-11-01Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='cos' homogen-type='method'> <method name='cos'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>cos</tt> - Trigonometrical cosine</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float cos(float <i>f</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the cosinus value for f.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::acos' to='predef::acos'>math/acos</ref> and <ref resolved='predef::sin' to='predef::sin'>math/sin</ref></p>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='errno' homogen-type='method'> <method name='errno'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>errno</tt> - return system error number</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int errno();<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function returns the system error from the last file operation. Note that you should normally use the function errno in the file object instead.</p> </text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='file/errno'>file/errno</ref></p>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='exece' homogen-type='method'> <method name='exece'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>exece</tt> - execute a program</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <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/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function transforms the Pike 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>
6559661996-11-06Fredrik Hübinette (Hubbe) </text> <group><note/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>The Pike driver _dies_ when this function is called. You must use fork() if you wish to execute a program and still run the Pike driver.</p> </text></group>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><example/><text> <tt><p>exece("/bin/ls", ({"-l"}));<br/> exece("/bin/sh", ({"-c", "echo $HOME"}), (["HOME":"/not/home"]));<br/> </p> </tt></text></group>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::fork' to='predef::fork'>files/fork</ref> and <ref to='file-&gt;pipe'>&gt;file-&gt;pipe</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='exp' homogen-type='method'> <method name='exp'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>exp</tt> - Natural exponent</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float exp(float <i>f</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the natural exponent of f. log( exp( x ) ) == x as long as exp(x) doesn't overflow an int.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
6559661996-11-06Fredrik Hübinette (Hubbe) 
6130721996-11-01Fredrik Hübinette (Hubbe) <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::pow' to='predef::pow'>math/pow</ref> and <ref resolved='predef::log' to='predef::log'>math/log</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='file_stat' homogen-type='method'> <method name='file_stat'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>file_stat</tt> - stat a file</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <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>file_stat returns an array of integers describing some properties<br/> about the file. Currently file_stat returns 7 entries:<br/> ({<br/> <dl><group><text><matrix> <r><c> mode, </c><c> /* file mode, protection bits etc. etc. */ </c></r> <r><c> size, </c><c> /* file size for regular files, -2 for dirs, -3 for links, -4 for otherwise */ </c></r> <r><c> atime, </c><c> /* last access time */ </c></r> <r><c> mtime, </c><c> /* last modify time */ </c></r> <r><c> ctime, </c><c> /* last status time change */ </c></r> <r><c> uid, </c><c> /* The user who owns this file */ </c></r> <r><c> gid </c><c> /* The group this file belongs to */ </c></r> </matrix> </text></group></dl>})<br/> If you give 1 as a second argument, file_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>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::get_dir' to='predef::get_dir'>files/get_dir</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='filesystem_stat' homogen-type='method'> <method name='filesystem_stat'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>filesystem_stat</tt> - stat a filesystem <br/> <dl><group><text><br/> </text></group></dl>SYNTAX<br/> <dl><group><text>mapping(string:atring|int) filesystem_stat(string file);<br/> </text></group></dl></p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p><dl><group><text>filesystem_stat returns a mapping describing some properties<br/> about the filesystem.<br/> Currently nine fields of the mapping are defined:<br/> </text></group></dl> </p> <p>([<br/> <dl><group><text>"blocksize":int, /* filesystem block size */<br/> <dl><group><text>"blocks":int, /* total # of blocks on file system<br/> <dl><group><text>* in units of blocksize */<br/> </text></group></dl>"bfree":int, /* total # of free blocks */<br/> "bavail":int, /* total # of free blocks<br/> <dl><group><text>* available to non-super-user */<br/> </text></group></dl>"files":int, /* total # of files */<br/> "ffree":int, /* total # of free files */<br/> "favail":int, /* total # of free files<br/> <dl><group><text>* available to non-super-user */<br/> </text></group></dl>"fstype":string /* target fs type name */<br/> "fsname":string /* target fs name */<br/> }) <br/> <br/> If there is no such file or directory, zero is returned.<br/> </text></group></dl></text></group></dl></p> </text>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>This function does not exist on all Operating Systems.
6130721996-11-01Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Depending on Operating System some of the above values may not<br/> be returned.<br/> <dl><group><text><br/> </text></group></dl>KEYWORDS<br/> <dl><group><text>file<br/> <dl><group><text><br/> </text></group></dl></text></group></dl>SEE ALSO<br/> <dl><group><text>files/file_stat<br/> <dl><group><text><br/> <br/> </text></group></dl></text></group></dl><br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='find_call_out' homogen-type='method'> <method name='find_call_out'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>find_call_out</tt> - find a call out in the queue</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int find_call_out(function <i>f</i>);<br/> or<br/> int find_call_out(mixed <i>id</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function searches the call out queue. If given a function as argument, it looks for the first call out scheduled to that function. The argument can also be a call out id as returned by call_out, in which case that call_out will be found. (Unless it has already been called.) find_call_out will then return how many seconds remains before that call will be executed. If no call is found, zero_type(find_call_out(f)) will return 1.</p> </text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='floor' homogen-type='method'> <method name='floor'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>floor</tt> - Truncate a number downward</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float floor(float <i>f</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the closest integral value lower or equal to x. Note that floor() does _not_ return an int, merely an integral value.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text> <group><seealso/><text> <p><ref resolved='predef::ceil' to='predef::ceil'>math/ceil</ref></p> </text></group>
6559661996-11-06Fredrik Hübinette (Hubbe) 
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='fork' homogen-type='method'> <method name='fork'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>fork</tt> - fork the process in two</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int fork();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>This function cause endless bugs if used without proper care.</p> </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref to='predef::exec'>files/exec</ref> and <ref to='file-&gt;pipe'>&gt;file-&gt;pipe</ref></p> </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='get_dir' homogen-type='method'> <method name='get_dir'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>get_dir</tt> - read a directory</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string *get_dir(string <i>dirname</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return an array of all filenames in the directory dir, or zero if no such directory exists.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::mkdir' to='predef::mkdir'>files/mkdir</ref> and <ref resolved='predef::cd' to='predef::cd'>files/cd</ref></p>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='getcwd' homogen-type='method'> <method name='getcwd'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>getcwd</tt> - return current working directory</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string getcwd();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>getcwd returns the current working directory.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::cd' to='predef::cd'>files/cd</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='getegid' homogen-type='method'> <method name='getegid'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>getegid</tt> - get the effective group ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int getegid();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Get the effective group ID.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/getuid'>system/getuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/geteuid'>system/geteuid</ref> and <ref to='system/setegid'>system/setegid</ref></p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='geteuid' homogen-type='method'> <method name='geteuid'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>geteuid</tt> - get the effective user ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int geteuid();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Get the effective user ID.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/getuid'>system/getuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/setegid'>system/setegid</ref> and <ref to='system/getegid'>system/getegid</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='getgid' homogen-type='method'> <method name='getgid'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>getgid</tt> - get the group ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int getgid();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Get the real group ID.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/getuid'>system/getuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/geteuid'>system/geteuid</ref>, <ref to='system/setegid'>system/setegid</ref> and <ref to='system/getegid'>system/getegid</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='gethostbyaddr' homogen-type='method'> <method name='gethostbyaddr'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>gethostbyaddr</tt> - gets information about a host given it's address</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>array gethostbyaddr(string <i>addr</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Returns an array with information about the specified IP address. </p> <p>The returned array contains the same information as that returned by gethostbyname().</p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text> <group><note/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function only exists on systems that have the gethostbyaddr(2) or similar system call.</p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref resolved='predef::gethostbyname' to='gethostbyname'>gethostbyname</ref></p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='gethostbyname' homogen-type='method'> <method name='gethostbyname'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>gethostbyname</tt> - gets information about a host given it's name</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>array gethostbyname(string <i>hostname</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Returns an array with information about the specified host. </p> <p>The array contains three elements: </p> <p>The first element is the hostname. </p> <p>The second element is an array(string) of IP numbers for the host. </p> <p>The third element is an array(string) of aliases for the host.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text> <group><note/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function only exists on systems that have the gethostbyname(2) or similar system call.</p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref resolved='predef::gethostbyaddr' to='gethostbyaddr'>gethostbyaddr</ref></p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='gethostname' homogen-type='method'> <method name='gethostname'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>gethostname</tt> - get the name of this host</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string gethostname();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Returns a string with the name of the host.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text> <group><note/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function only exists on systems that have the gethostname(2) or uname(2) system calls. </p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='getpgrp' homogen-type='method'> <method name='getpgrp'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>getpgrp</tt> - get the process group ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int getpgrp();<br/> or<br/> int getpgrp(int <i>pid</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>With no argguments or with 'pid' equal to zero, returns the process group ID of this process. </p> <p>If 'pid' is specified, returns the process group ID of that process.</p> Processes</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/getpid'>system/getpid</ref> and <ref to='system/getppid'>system/getppid</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='getpid' homogen-type='method'> <method name='getpid'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>getpid</tt> - get the process ID</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int getpid();<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Returns the process ID of this process.</p> Processes</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref to='system/getppid'>system/getppid</ref> and <ref to='system/getpgrp'>system/getpgrp</ref></p> </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='getppid' homogen-type='method'> <method name='getppid'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>getppid</tt> - get the parent process ID</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int getppid();<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Returns the process ID of the parent process.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Processes</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/getpid'>system/getpid</ref> and <ref to='system/getpgrp'>system/getpgrp</ref></p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group>
88688c2000-09-15Leif Stensson </doc> </docgroup> <docgroup homogen-name='getsid' homogen-type='method'> <method name='getsid'/><doc placeholder='true'> <text> <p><tt>getsid</tt> - get the process session ID</p> <tt><p>int getsid();<br/> or<br/> int getsid(int <i>pid</i>);<br/> </p> </tt> <p>Get the process session ID for the given process. If pid is not specified, the session ID for the current process will be returned.</p> Processes</text> <group><seealso/><text> <p><ref to='system/getpid'>system/getpid</ref>, <ref to='system/getpgrp'>system/getpgrp</ref> and <ref to='system/setsid'>system/setsid</ref></p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='getuid' homogen-type='method'> <method name='getuid'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>getuid</tt> - get the user ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int getuid();<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Get the real user ID.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/geteuid'>system/geteuid</ref>, <ref to='system/setegid'>system/setegid</ref> and <ref to='system/getegid'>system/getegid</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='hardlink' homogen-type='method'> <method name='hardlink'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>hardlink</tt> - create a hardlink</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void hardlink(string <i>from</i>, string <i>to</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Creates a hardlink named 'to' from the file 'from'.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/symlink'>system/symlink</ref>, <ref resolved='predef::mv' to='predef::mv'>files/mv</ref> and <ref resolved='predef::rm' to='predef::rm'>files/rm</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='initgroups' homogen-type='method'> <method name='initgroups'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>initgroups</tt> - initialize the group access list</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void initgroups(string <i>username</i>, int <i>base_gid</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Initializes the group access list according to the system group database. 'base_gid' is also added to the group access list.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/getuid'>system/getuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/geteuid'>system/geteuid</ref>, <ref to='system/setegid'>system/setegid</ref>, <ref to='system/getegid'>system/getegid</ref>, <ref to='system/getgroups'>system/getgroups</ref> and <ref to='system/setgroups'>system/setgroups</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='log' homogen-type='method'> <method name='log'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>log</tt> - Natural logarithm</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float log(float <i>f</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the natural logarithm of f. exp( log(x) ) == x for x &gt; 0.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::pow' to='predef::pow'>math/pow</ref> and <ref resolved='predef::exp' to='predef::exp'>math/exp</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='mkdir' homogen-type='method'> <method name='mkdir'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>mkdir</tt> - make directory</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int mkdir(string <i>dirname</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Create a directory, return zero if it fails and nonzero if it fails.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6130721996-11-01Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='mv' homogen-type='method'> <method name='mv'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>mv</tt> - move a file (may handle directiories as well)</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int mv(string <i>from</i>,string <i>to</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::rm' to='predef::rm'>files/rm</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='openlog' homogen-type='method'> <method name='openlog'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>openlog</tt> - initializes the connection to syslogd</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void openlog(string <i>ident</i>, int <i>options</i>, <i>facility</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Initializes the connection to syslogd. </p> <p>The 'ident' argument specifies an identifier to tag all logentries with. </p> <p>'options' is a bitfield specifying the behaviour of the message logging. Valid options are: </p> <p><dl><group><text><matrix> <r><c> LOG_PID </c><c> Log the process ID with each message. </c></r> <r><c> LOG_CONS </c><c> Write messages to the console if they can't be sent to syslogd. </c></r> <r><c> LOG_NDELAY </c><c> Open the connection to syslogd now and not later. </c></r> <r><c> LOG_NOWAIT </c><c> Do not wait for subprocesses talking to syslogd. </c></r> </matrix> </text></group></dl> </p> <p>'facility' specifies what subsystem you want to log as. Valid facilities are: </p> <p><dl><group><text><matrix> <r><c> LOG_AUTH </c><c> Authorization subsystem </c></r> <r><c> LOG_AUTHPRIV </c></r> <r><c> LOG_CRON </c><c> Crontab subsystem </c></r> <r><c> LOG_DAEMON </c><c> System daemons </c></r> <r><c> LOG_KERN </c><c> Kernel subsystem (NOT USABLE) </c></r> <r><c> LOG_LOCAL </c><c> For local use </c></r> <r><c> LOG_LOCAL[1-7] </c><c> For local use </c></r> <r><c> LOG_LPR </c><c> Line printer spooling system </c></r> <r><c> LOG_MAIL </c><c> Mail subsystem </c></r> <r><c> LOG_NEWS </c><c> Network news subsystem </c></r> <r><c> LOG_SYSLOG </c></r> <r><c> LOG_USER </c></r> <r><c> LOG_UUCP </c><c> UUCP subsystem </c></r> </matrix> </text></group></dl></p> </text> <group><note/><text> <p>Only available on systems with syslog(3).
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) BUGS LOG_NOWAIT should probably always be specified.</p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='syslog'>syslog</ref>, <ref to='closelog'>closelog</ref> and <ref to='setlogmask'>setlogmask</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='pow' homogen-type='method'> <method name='pow'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>pow</tt> - Raise a number to the power of another.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float pow(float <i>n</i>, float <i>x</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return n raised to the power of x.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::exp' to='predef::exp'>math/exp</ref> and <ref resolved='predef::log' to='predef::log'>math/log</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='readlink' homogen-type='method'> <method name='readlink'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>readlink</tt> - read a symbolic link</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string readlink(string <i>linkname</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Returns what the symbolic link 'linkname' points to.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/symlink'>system/symlink</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='remove_call_out' homogen-type='method'> <method name='remove_call_out'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>remove_call_out</tt> - remove a call out from the call out queue</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int remove_call_out(function <i>f</i>);<br/> or<br/> int remove_call_out(function <i>id</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <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. You can also give a call out id as argument. (as returned by call_out)</p> </text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='rm' homogen-type='method'> <method name='rm'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>rm</tt> - remove file or directory</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int rm(string <i>f</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Remove a file or directory, return 0 if it fails. Nonzero otherwise.</p> file</text>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref resolved='predef::mkdir' to='predef::mkdir'>files/mkdir</ref></p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='setegid' homogen-type='method'> <method name='setegid'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>setegid</tt> - set the effective group ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void setegid(int <i>uid</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Sets the effective group ID to 'gid'.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/getuid'>system/getuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/geteuid'>system/geteuid</ref> and <ref to='system/getegid'>system/getegid</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='seteuid' homogen-type='method'> <method name='seteuid'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>seteuid</tt> - set the effective user ID</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void seteuid(int <i>uid</i>);<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Sets the effective user ID to 'uid'.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/getuid'>system/getuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/geteuid'>system/geteuid</ref>, <ref to='system/setegid'>system/setegid</ref> and <ref to='system/getegid'>system/getegid</ref></p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='setgid' homogen-type='method'> <method name='setgid'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>setgid</tt> - set the group ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void setgid(int <i>gid</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Sets the real group ID, effective group ID and saved group ID to 'gid'.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/setuid'>system/setuid</ref>, <ref to='system/getuid'>system/getuid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/geteuid'>system/geteuid</ref>, <ref to='system/setegid'>system/setegid</ref> and <ref to='system/getegid'>system/getegid</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
88688c2000-09-15Leif Stensson </doc> </docgroup> <docgroup homogen-name='setpgrp' homogen-type='method'> <method name='setpgrp'/><doc placeholder='true'> <text> <p><tt>setpgrp</tt> - set the process group ID</p> <tt><p>int setpgrp();<br/> </p> </tt> <p>Set a new process group ID for the current process, and return it.</p> Processes</text> <group><seealso/><text> <p><ref to='system/getpid'>system/getpid</ref>, <ref to='system/getpgrp'>system/getpgrp</ref> and <ref to='system/setsid'>system/setsid</ref></p> </text></group> </doc> </docgroup> <docgroup homogen-name='setsid' homogen-type='method'> <method name='setsid'/><doc placeholder='true'> <text> <p><tt>setsid</tt> - set the process session ID</p> <tt><p>int setsid();<br/> </p> </tt> <p>Set a new process session ID for the current process, and return it.</p> Processes</text> <group><seealso/><text> <p><ref to='system/getpid'>system/getpid</ref>, <ref to='system/setpgrp'>system/setpgrp</ref> and <ref to='system/getsid'>system/getsid</ref></p> </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='setuid' homogen-type='method'> <method name='setuid'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>setuid</tt> - set the user ID</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void setuid(int <i>uid</i>);<br/>
6130721996-11-01Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Sets the real user ID, effective user ID and saved user ID to 'uid'.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) Usersecurity</text>
6130721996-11-01Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/getuid'>system/getuid</ref>, <ref to='system/setgid'>system/setgid</ref>, <ref to='system/getgid'>system/getgid</ref>, <ref to='system/seteuid'>system/seteuid</ref>, <ref to='system/geteuid'>system/geteuid</ref>, <ref to='system/setegid'>system/setegid</ref> and <ref to='system/getegid'>system/getegid</ref></p>
6130721996-11-01Fredrik Hübinette (Hubbe) </text></group>
6be0031996-11-03Mirar (Pontus Hagland) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='sin' homogen-type='method'> <method name='sin'/><doc placeholder='true'>
6be0031996-11-03Mirar (Pontus Hagland) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>sin</tt> - Trigonometrical sine</p>
6be0031996-11-03Mirar (Pontus Hagland) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float sin(float <i>f</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the sinus value for f.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::asin' to='predef::asin'>math/asin</ref> and <ref resolved='predef::cos' to='predef::cos'>math/cos</ref></p>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group>
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='sprintf' homogen-type='method'> <method name='sprintf'/><doc placeholder='true'>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>sprintf</tt> - print the result from sprintf</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string sprintf(string <i>format</i>,mixed <i>arg</i>,....);<br/> </p> </tt> <p>The format string is a string containing a description of how to output the data in the rest of the arguments. This string should generally speaking have one %&lt;modifiers&gt;&lt;operator&gt; (examples: %s, %0d, %-=20s) for each of the rest arguments. </p> <p>Modifiers: </p> <p><matrix> <r><c> 0 </c><c> Zero pad numbers (implies right justification) </c></r> <r><c> ! </c><c> Toggle truncation </c></r> <r><c> ' ' (space) </c><c> pad positive integers with a space </c></r> <r><c> + </c><c> pad positive integers with a plus sign </c></r> <r><c> - </c><c> left adjusted within field size (default is right) </c></r> <r><c> | </c><c> centered within field size </c></r> <r><c> = </c><c> column mode if strings are greater than field size </c></r> <r><c> / </c><c> Rough linebreak (break at exactly fieldsize instead of between words) </c></r> <r><c> # </c><c> table mode, print a list of '\n' separated word (top-to-bottom order) </c></r> <r><c> $ </c><c> Inverse table mode (left-to-right order) </c></r> <r><c> n </c><c> (where n is a number or *) a number specifies field size </c></r> <r><c> .n </c><c> set precision </c></r> <r><c> :n </c><c> set field size &amp; precision </c></r> <r><c> ;n </c><c> Set column width </c></r> <r><c> * </c><c> if n is a * then next argument is used for precision/field size </c></r> <r><c> 'X' </c><c> Set a pad string. ' cannot be a part of the pad_string (yet) </c></r> <r><c> ~ </c><c> Get pad string from argument list. </c></r> <r><c> &lt; </c><c> Use same arg again </c></r> <r><c> ^ </c><c> repeat this on every line produced </c></r> <r><c> @ </c><c> do this format for each entry in argument array </c></r> <r><c> &gt; </c><c> Put the string at the bottom end of column instead of top </c></r> <r><c> _ </c><c> Set width to the length of data </c></r> </matrix>
6130721996-11-01Fredrik Hübinette (Hubbe)  </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Operators:
6130721996-11-01Fredrik Hübinette (Hubbe) </p> <p><matrix>
431c431998-12-31Fredrik Hübinette (Hubbe) <r><c> %% </c><c> percent </c></r> <r><c> %d </c><c> signed decimal int </c></r> <r><c> %u </c><c> unsigned decimal int (doesn't really exist in Pike) </c></r> <r><c> %o </c><c> unsigned octal int </c></r> <r><c> %x </c><c> lowercase unsigned hexadecimal int </c></r> <r><c> %X </c><c> uppercase unsigned hexadecimal int </c></r> <r><c> %c </c><c> char (or short with %2c, %3c gives 3 bytes etc.) </c></r> <r><c> %f </c><c> float </c></r> <r><c> %g </c><c> heruistically chosen representation of float </c></r> <r><c> %e </c><c> exponential notation float </c></r> <r><c> %s </c><c> string </c></r> <r><c> %O </c><c> any type (debug style) </c></r> <r><c> %n </c><c> nop </c></r> <r><c> %t </c><c> type of argument </c></r> <r><c> %&lt;modifiers&gt;{format%} </c><c> do a format for every index in an array. </c></r>
6130721996-11-01Fredrik Hübinette (Hubbe) </matrix> </p> </text>
431c431998-12-31Fredrik Hübinette (Hubbe) <group><example/><text> <tt><p>Pike v0.1 Running Hilfe v1.2 (Incremental Pike 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/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) string</text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref to='sscanf'>sscanf</ref></p> </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='sqrt' homogen-type='method'> <method name='sqrt'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>sqrt</tt> - Square root</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float sqrt(float <i>f</i>);<br/> or<br/> int sqrt(int <i>i</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the square root of f, or in the second case, the square root truncated to the closest lower integer.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float and int</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='strerror' homogen-type='method'> <method name='strerror'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>strerror</tt> - return a string describing an error</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string strerror(int <i>errno</i>);<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function returns a description of an error code. The error code is usually obtained from the file-&gt;errno() call.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>This function may not be available on all platforms. </p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group>
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='symlink' homogen-type='method'> <method name='symlink'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>symlink</tt> - create a symbolic link</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void symlink(string <i>from</i>, string <i>to</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Creates a symbolic link named 'to' pointing to 'from'.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='system/hardlink'>system/hardlink</ref>, <ref to='system/readlink'>system/readlink</ref>, <ref resolved='predef::mv' to='predef::mv'>files/mv</ref> and <ref resolved='predef::rm' to='predef::rm'>files/rm</ref></p>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='tan' homogen-type='method'> <method name='tan'/><doc placeholder='true'>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>tan</tt> - Trigonometrical tangent</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>float tan(float <i>f</i>);<br/>
6559661996-11-06Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Return the tangent value for f.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) float</text>
6559661996-11-06Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <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>
6559661996-11-06Fredrik Hübinette (Hubbe) </text></group>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='uname' homogen-type='method'> <method name='uname'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>uname</tt> - get operating system information</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>mapping(string:string) <i>uname</i>();<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Returns a mapping describing the operating system.
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>The mapping contains the following fields:
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><matrix> <r><c> </c><c> "sysname": </c><c> Operating system name </c></r> <r><c> </c><c> "nodename": "release": "version": "machine": </c><c> Host name Release of this OS Version number of this OS Machine architecture </c></r> </matrix>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>This function only exists on systems that have the uname(2) system call. </p> <p/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='werror' homogen-type='method'> <method name='werror'/><doc placeholder='true'>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>werror</tt> - write to stderr</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void werror(string <i>s</i>);<br/>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Writes a message to stderr. Stderr is normally the console, even if the process output has been redirected to a file or pipe.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) file</text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
6559661996-11-06Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <module name='Calendar'>
f628372000-08-04Mirar (Pontus Hagland) <doc> <text> <p>subclass Ruleset This is the container class for rules.</p> </text> </doc> <docgroup homogen-name='set_abbr2zone' homogen-type='method'> <method name='set_abbr2zone'> <returntype> <object>Ruleset </object></returntype> <arguments><argument name='abbr2zone'><type> <mapping><indextype><string/></indextype> <valuetype><string/></valuetype></mapping></type></argument> </arguments> </method><doc> <text> <p>Sets the guess-mapping for timezones. Default is the mapping</p> <p><pre> Abbreviation Interpretation AMT America/Manaus [UTC-4] AST America/Curacao [UTC-4] CDT America/Costa_Rica [UTC-5] CST America/El Salvador [UTC-6] EST America/Panama [UTC-5] GST Asia/Dubai [UTC+4] IST Asia/Jerusalem [UTC+2] WST Australia/Perth [UTC+8] </pre> </p> </text> <group><seealso/><text> <p><ref>YMD.parse</ref></p></text></group> </doc> </docgroup>
e04f5e2000-08-01Mirar (Pontus Hagland) <module name='Austrian'> <doc> <text> <p> Same as the ISO calendar, but with austrian as the default language.</p> <p>This calendar exist only for backwards compatible purposes. </p> </text> </doc> </module>
30d57f2000-07-12Mirar (Pontus Hagland) <class name='Calendar'> <doc> <text> <p>This is the base class of the calendars.</p> </text> </doc> <docgroup homogen-name='now' homogen-type='method'> <method name='now'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Give the zero-length time period of the current time.</p> </text> </doc> </docgroup> </class> <module name='Coptic'> <doc> <text> <p> This is the Coptic Orthodox Church calendar, that starts the 11th or 12th September and has 13 months. </p> </text> <group><note/><text> <p>The (default) names of the months are different then other the emacs calendar; I do not know which ones are used - the difference seem to be only the transcription of the phonetic sounds (B &lt;-&gt; P, etc).</p> <p>I do not know for how long back the calendar is valid, either. My sources claim that the calendar is synchronized with the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> calendar, which is odd. </p> </text></group> </doc> </module> <module name='Discordian'> <doc> <text> <p>The Discordian calendar, as described on page 34 in the fourth edition of Principia Discordia.</p> <p>Chaotic enough, it's quite simpler then the Gregorian calendar; weeks are 5 days, and evens up on a year. Months are 73 days.</p> <p>The leap day is inserted at the 60th day of the first month (Chaos), giving the first month 74 days. The description of the calendar is a "perpetual date converter from the gregorian to the POEE calendar", so the leap years are the same as the gregorians.</p> <p>The Principia calls months "seasons", but for simplicity I call them months in this calendar.</p> <p>If anyone know more about how to treat the leap day - now it is inserted in the month and week where it lands, rather then being separated from month and weeks, I'm interested to know.</p> <p>- Mirar, Pope of POEE. </p> </text> </doc> </module> <module name='Event'> <doc> <text> <p>subclass Event <ref resolved='predef::Calendar.Event'>Event</ref> is a base class, defining what methods an Event need to have. subclass Day_Event <ref>Day_Event</ref> is a base class, extending <ref resolved='predef::Calendar.Event'>Event</ref> for events that are single days, using julian day numbers for the calculations.</p> <p>subclass Nameday This is created by the <ref>Namedays</ref> classes to represent an event for a name. subclass Namedays
26f9ac2000-09-30Mirar (Pontus Hagland)  This contains a ruleset about namedays.
30d57f2000-07-12Mirar (Pontus Hagland) subclass Date This class represents the event of a given gregorian date. For instance, <tt>Event.Date(12,10)-&gt;next(Day())</tt> finds the next 12 of October.</p> <p>subclass Date_Weekday This class represents the event that a given gregorian date appears a given weekday. For instance, <tt>Event.Date_Weekday(12,10,5)-&gt;next(Day())</tt> finds the next 12 of October that is a friday.</p> <p>subclass Monthday_Weekday This class represents the event that a given gregorian day of month appears a given weekday. For instance,
566bfc2000-10-26Mirar (Pontus Hagland)  <tt>Event.Monthday_Weekday(13,5)-&gt;next(Day())</tt>
30d57f2000-07-12Mirar (Pontus Hagland)  finds the next friday the 13th.</p> <p>subclass Weekday This class represents any given weekday. For instance, <tt>Event.Weekday(5)-&gt;next(Day())</tt> finds the next friday.</p> <p> These are also available as the pre-defined events "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" and "sunday".</p> <p>subclass SuperEvent This class holds any number of events, and adds the functionality of event flags. </p> </text> <group><note/><text> <p>Scanning (scan_events,next,etc) will drop flag information. Dig out what you need with -&gt;<ref resolved='predef::Calendar.Event.holidays'>holidays</ref> et al first.</p> </text></group> </doc> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='month_day'><type><int/></type></argument> <argument name='month'><type><int/></type></argument> </arguments> </method><doc> <text> <p>The event is created by a given month day and a month number (1=January, 12=December).</p> </text> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='month_day'><type><int/></type></argument> <argument name='month'><type><int/></type></argument> <argument name='weekday'><type><int/></type></argument> </arguments> </method><doc> <text> <p>The event is created by a given month day, a month number (1=January, 12=December), and a weekday number (1=Monday, 7=Sunday). </p> </text> <group><note/><text> <p>The week day numbers used are the same as the day of week in the <ref resolved='predef::Calendar.ISO'>ISO</ref> calendar - the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> calendar has 1=Sunday, 7=Saturday.</p> </text></group> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='month_day'><type><int/></type></argument> <argument name='weekday'><type><int/></type></argument> </arguments> </method><doc> <text> <p>The event is created by a given month day, and a weekday number (1=Monday, 7=Sunday). </p> </text> <group><note/><text> <p>The week day numbers used are the same as the day of week in the <ref resolved='predef::Calendar.ISO'>ISO</ref> calendar - the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> calendar has 1=Sunday, 7=Saturday.</p> </text></group> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype>
7d4e8d2000-08-11Mirar (Pontus Hagland)  <arguments><argument name='weekday'><type><int/></type></argument>
30d57f2000-07-12Mirar (Pontus Hagland)  </arguments> </method><doc> <text>
7d4e8d2000-08-11Mirar (Pontus Hagland) <p>The event is created by a given weekday number (1=Monday, 7=Sunday).
30d57f2000-07-12Mirar (Pontus Hagland) </p> </text> <group><note/><text> <p>The week day numbers used are the same as the day of week in the <ref resolved='predef::Calendar.ISO'>ISO</ref> calendar -
51a2cf2000-09-27Mirar (Pontus Hagland) not the <ref resolved='predef::Calendar.Gregorian'>Gregorian</ref> or <ref resolved='predef::Calendar.Julian'>Julian</ref>
30d57f2000-07-12Mirar (Pontus Hagland) calendar that has 1=Sunday, 7=Saturday.</p> </text></group> </doc> </docgroup> <docgroup homogen-type='method'> <method name='filter_flag'> <returntype> <object>SuperEvent </object></returntype> <arguments><argument name='flag'><type><string/></type></argument> </arguments> </method><method name='holidays'> <returntype> <object>SuperEvent </object></returntype> <arguments> </arguments> </method><method name='flagdays'> <returntype> <object>SuperEvent </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Filter out the events that has a certain flag set. Holidays (flag "h") are the days that are marked red in the calendar (non-working days), Flagdays (flag "f") are the days that the flag should be visible in (only some countries).</p> </text> </doc> </docgroup> <docgroup homogen-name='Event' homogen-type='inherit'> <inherit name='Event'><classname resolved='predef::Calendar.Event'>Event</classname></inherit> </docgroup> <docgroup homogen-name='namedays' homogen-type='method'> <method name='namedays'> <returntype> <mapping><indextype> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></indextype> <valuetype> <array><valuetype><string/></valuetype></array></valuetype></mapping></returntype> <arguments><argument name='t'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>Gives back an table of days with names that occur during the time period. Note that days without names will not appear in the returned mapping.</p> </text> </doc> </docgroup> <docgroup homogen-name='names' homogen-type='method'> <method name='names'> <returntype> <array><valuetype><string/></valuetype></array></returntype> <arguments><argument name='t'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>Gives back an array of names that occur during the time period, in no particular order.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='next'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='from'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> <argument name='including'><type> <or><void/><int><min>0</min><max>1</max></int></or></type></argument> </arguments> </method><method name='previous'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='from'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> <argument name='including'><type> <or><void/><int><min>0</min><max>1</max></int></or></type></argument> </arguments> </method><doc> <text> <p>This calculates the next or previous occurance of the event, from the given timerange's <b>start</b>, including any event occuring at the start if that flag is set.</p> <p>It returns zero if there is no next event.</p> <p>This method is virtual in the base class.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='previous'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='from'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> <argument name='including'><type> <or><void/><int><min>0</min><max>1</max></int></or></type></argument> </arguments> </method><method name='next'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='from'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> <argument name='including'><type> <or><void/><int><min>0</min><max>1</max></int></or></type></argument> </arguments>
26f9ac2000-09-30Mirar (Pontus Hagland) </method></docgroup>
30d57f2000-07-12Mirar (Pontus Hagland) <docgroup homogen-type='method'> <method name='scan'> <returntype> <array><valuetype> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></returntype> <arguments><argument name='in'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='next'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='from'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='next'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='from'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> <argument name='including'><type> <int><min>0</min><max>1</max></int></type></argument> </arguments> </method><doc> <text> <p>These methods are implemented, using the virtual method <ref resolved='predef::Calendar.Event.scan_jd'>scan_jd</ref>. </p> </text> <group><seealso/><text> <p><ref resolved='predef::Calendar.Event'>Event</ref></p></text></group> </doc> </docgroup> <docgroup homogen-name='scan_jd' homogen-type='method'> <method name='scan_jd'> <returntype> <object>int </object></returntype> <arguments><argument name='realm'><type> <object resolved='predef::Calendar.Calendar'>Calendar</object></type></argument> <argument name='jd'><type><int/></type></argument> <argument name='direction'><type> <or> <int><min>-1</min><max>-1</max></int> <object resolved='predef::Calendar.Event.scan_jd'/><int><min>1</min><max>1</max></int></or></type></argument> </arguments> </method><doc> <text> <p>These methods has to be defined, and is what really does some work. It should return the next or previos julian day (&gt;<i>jd</i>) when the event occurs, or the constant <tt>NODAY</tt> if it doesn't.</p> <p><i>direction</i> <tt>1</tt> is forward (next), <tt>-1</tt> is backward (previous).</p> </text> </doc> </docgroup> </module> <module name='Gregorian'> <doc> <text> <p> This is the standard conservative christian calendar, used regularly in some countries - USA, for instance - and which derivate - <ref>the ISO calendar</ref> - is used in most of europe. </p> </text> </doc> </module> <module name='ISO'> <doc> <text> <p> This is the standard western calendar, which is a derivate of the Gregorian calendar, but with weeks that starts on monday instead of sunday.</p> <p/> </text> </doc> <docgroup homogen-name='Gregorian' homogen-type='inherit'> <inherit name='Gregorian'><classname resolved='predef::Calendar.Gregorian'>Gregorian</classname></inherit> </docgroup> </module> <module name='Islamic'> <doc> <text> <p> This is the islamic calendar. Due to some sources, they decide the first day of the new months on a month-to-month basis (sightings of the new moon), so it's probably not <i>that</i> accurate. If someone can confirm (or deny) accuracy better than that, please contact me so I can change this statement.</p> <p> It's vaugely based on rules presented in algorithms by Dershowitz, Reingold and Clamen, 'Calendrical Calculations'. It is the same that's used in Emacs calendar mode.</p> <p>known bugs: I have currently no idea how the arabic countries count the week. Follow the same rules as ISO for now... The time is also suspicious; the *day* really starts at sunrise (sunset?) and not midnight, the hours of the day is not correct. Also don't know what to call years before 1 - go for "BH"; positive years are "AH", anno Hegirac. </p> </text> </doc> </module>
51a2cf2000-09-27Mirar (Pontus Hagland) <module name='Julian'> <doc> <text> <p> This is the Julian calendar, conjured up by the old Romans when their calendar were just too wierd. It was used by the christians as so far as the 18th century in some parts of the world. (Especially the protestantic and orthodox parts.) </p> </text> <group><note/><text> <p>Don't confuse the <i>julian day</i> with the Julian calendar. The former is just a linear numbering of days, used in the Calendar module as a common unit for absolute time.</p> </text></group> </doc> <docgroup homogen-name='YMD' homogen-type='inherit'> <inherit name='YMD'><classname resolved='predef::Calendar.YMD'>YMD</classname></inherit> </docgroup> </module>
30d57f2000-07-12Mirar (Pontus Hagland) <module name='Roman'> <doc> <text> <p> base for all Roman-kind of calendars ie, one with years, months, weeks and days </p> </text> </doc> </module> <module name='Stardate'> <doc> <text>
5f1c872000-09-27Mirar (Pontus Hagland) <p>This implements TNG stardates.</p>
30d57f2000-07-12Mirar (Pontus Hagland) </text> </doc>
5f1c872000-09-27Mirar (Pontus Hagland) <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='...'><type><mixed/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='date'><type> <or><int/><float/></or></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments> </arguments> </method><doc>
30d57f2000-07-12Mirar (Pontus Hagland) <text>
5f1c872000-09-27Mirar (Pontus Hagland) <p> Apart from the standard creation methods (julian day, etc), you can create a stardate from the stardate number. The length of the period will then be zero.</p> <p> You can also omit any arguments to create now.</p> <p>known bugs: Since the precision is limited to the float type of pike you can get non-precise results:</p> <p> <pre> &gt; Calendar.Second(Calendar.Stardate.Day(Calendar.Year())); Result: Second(Fri 31 Dec 1999 23:59:18 CET - Sun 31 Dec 2000 23:59:18 CET) </pre></p>
30d57f2000-07-12Mirar (Pontus Hagland) </text> </doc>
5f1c872000-09-27Mirar (Pontus Hagland) </docgroup> <docgroup homogen-name='now' homogen-type='method'> <method name='now'> <returntype> <object>TimeofDay </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Give the zero-length time period of the current time.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='number_of_seconds'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='number_of_days'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><doc> <text> <p> This gives back the Gregorian/Earth/ISO number of seconds and number of days, for convinience and conversion to other calendars. string format_long() string format_short() string format_vshort() Format the stardate tick nicely. <pre> long "-322537.312" short "77463.312" (w/o &gt;100000-component) short "7463.312" (w/o &gt;10000-component) </pre></p> </text> </doc> </docgroup> <docgroup homogen-name='tics' homogen-type='method'> <method name='tics'> <returntype> <object>float </object></returntype> <arguments> </arguments> </method><doc> <text> <p>This gives back the number of stardate tics in the period.</p> </text> </doc> </docgroup>
30d57f2000-07-12Mirar (Pontus Hagland) </module> <class name='SuperTimeRange'> <doc> <text> <p>This class handles the cases where you have a time period with holes. These can be created by the <tt>^</tt> or <tt>|</tt> operators on time ranges.</p> </text> </doc> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='parts'><type> <array><valuetype> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></type></argument> </arguments> </method><doc> <text> <p>A SuperTimeRange must have at least two parts, two time ranges. Otherwise, it's either not a time period at all or a normal time period.</p> </text> </doc> </docgroup> <docgroup homogen-name='TimeRange' homogen-type='inherit'> <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> </docgroup> <docgroup homogen-name='nulltimerange' homogen-type='constant'> <constant name='nulltimerange'><typevalue> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></typevalue> </constant><doc> <text> <p>This represents the null time range, which, to differ from the zero time range (the zero-length time range), isn't placed in time. This is the result of for instance <ref resolved='predef::Calendar.TimeRange.`&amp;'>&amp;`&amp;</ref> between two strict non-overlapping timeranges - no time at all.</p> <p>It has a constant, <tt>is_nulltimerange</tt>, which is non-zero. <tt>`!</tt> on this timerange is true.</p> </text> </doc> </docgroup> </class> <module name='Swedish'> <doc> <text> <p> Same as the ISO calendar,
e04f5e2000-08-01Mirar (Pontus Hagland) but with swedish as the default language.</p>
30d57f2000-07-12Mirar (Pontus Hagland)  <p>This calendar exist only for backwards compatible purposes. </p> </text> </doc> </module> <module name='TZnames'> <doc> <text>
2ba19d2000-08-02Mirar (Pontus Hagland) <p>This module contains listnings of available timezones, in some different ways </p>
30d57f2000-07-12Mirar (Pontus Hagland) <p>This module is a mapping of the names of all the geographical (political) based timezones. It looks mainly like <pre> (["Europe":({"Stockholm","Paris",...}), "America":({"Chicago","Panama",...}), ... ]) </pre></p> <p>It is mainly there for easy and reliable ways of making user interfaces to select timezone.</p> <p>The Posix and standard timezones (like CET, PST8PDT, etc) are not listed.</p> </text>
2ba19d2000-08-02Mirar (Pontus Hagland) 
30d57f2000-07-12Mirar (Pontus Hagland)  </doc>
2ba19d2000-08-02Mirar (Pontus Hagland) <docgroup homogen-name='abbr2zones' homogen-type='constant'> <constant name='abbr2zones'><typevalue> <mapping><indextype><string/></indextype> <valuetype> <array><valuetype><string/></valuetype></array></valuetype></mapping></typevalue> </constant><doc> <text> <p>This mapping is used to look up abbreviation to the possible regional zones.</p> <p>It looks like this: <pre> ([ "CET": ({ "Europe/Stockholm", &lt;i&gt;[...]&lt;/i&gt; }), "CST": ({ "America/Chicago", "Australia/Adelaide", &lt;i&gt;[...]&lt;/i&gt; }), &lt;i&gt;[...]&lt;/i&gt; }),
7d4e8d2000-08-11Mirar (Pontus Hagland) </pre></p> <p>Note this: Just because it's noted "CST" doesn't mean it's a unique timezone. There is about 7 *different* timezones that uses "CST" as abbreviation; not at the same time, though, so the DWIM routines checks this before it's satisfied. Same with some other timezones.</p> <p>For most timezones, there is a number of region timezones that for the given time are equal. This is because region timezones include rules about local summer time shifts and possible historic shifts.</p> <p>The <ref>YMD.parse</ref> functions can handle timezone abbreviations by guessing.</p>
2ba19d2000-08-02Mirar (Pontus Hagland) </text> </doc> </docgroup> <docgroup homogen-name='zones' homogen-type='constant'> <constant name='zones'><typevalue> <mapping><indextype><string/></indextype> <valuetype> <array><valuetype><string/></valuetype></array></valuetype></mapping></typevalue> </constant><doc> <text> <p>This constant is a mapping that can be used to loop over to get all the region-based timezones.</p> <p>It looks like this: <pre> ([ "America": ({ "Los_Angeles", "Chicago", &lt;i&gt;[...]&lt;/i&gt; }), "Europe": ({ "Stockholm", &lt;i&gt;[...]&lt;/i&gt; }), &lt;i&gt;[...]&lt;/i&gt; }),
7d4e8d2000-08-11Mirar (Pontus Hagland) </pre></p> <p>Please note that loading all the timezones can take some time, since they are generated and compiled on the fly.</p>
2ba19d2000-08-02Mirar (Pontus Hagland) </text> </doc> </docgroup>
30d57f2000-07-12Mirar (Pontus Hagland) </module> <module name='Time'> <doc> <text> <p> Base for time of day in calendars, ie calendars with hours, minutes, seconds</p> <p>This module can't be used by itself, but is inherited by other modules (<ref resolved='predef::Calendar.ISO'>ISO</ref> by <ref resolved='predef::Calendar.YMD'>YMD</ref>, for instance).</p> </text> </doc> <docgroup homogen-name='datetime' homogen-type='method'> <method name='datetime'> <returntype> <object>mapping </object></returntype> <arguments> </arguments> </method><doc> <text> <p>This gives back a mapping with the relevant time information (representing the start of the period); <pre> ([ "year": int // year number (2000 AD=2000, 1 BC==0) "month": int(1..) // month of year "day": int(1..) // day of month "yearday": int(1..) // day of year "week": int(1..) // week of year "week_day": int(1..) // day of week (depending on calendar) "hour": int(0..) // hour of day, including dst "minute": int(0..59) // minute of hour "second": int(0..59) // second of minute "fraction": float // fraction of second "timezone": int // offset to utc, including dst "unix": int // unix time "julian": float // julian day ]); </pre></p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='format_iso_ymd'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_ymd'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_ymd_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_ymd_xshort'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_iso_week'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_iso_week_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_week'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_week_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_month'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_month_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_iso_time'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_time'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_time_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_time_xshort'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_mtime'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_xtime'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_tod'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_xtod'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_mod'> <returntype> <object>string </object></returntype> <arguments> </arguments>
2599652000-11-13Mirar (Pontus Hagland) </method><method name='format_nice'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_nicez'> <returntype> <object>string </object></returntype> <arguments> </arguments>
30d57f2000-07-12Mirar (Pontus Hagland) </method><doc> <text> <p>Format the object into nice strings; <pre> iso_ymd "2000-06-02 (Jun) -W22-5 (Fri)" [2] ext_ymd "Friday, 2 June 2000" [2] ymd "2000-06-02" ymd_short "20000602" ymd_xshort "000602" [1] iso_week "2000-W22" iso_week_short "2000W22" week "2000-w22" [2] week_short "2000w22" [2] month "2000-06" month_short "200006" [1] iso_time "2000-06-02 (Jun) -W22-5 (Fri) 20:53:14 UTC+1" [2] ext_time "Friday, 2 June 2000, 20:53:14" [2] ctime "Fri Jun 4 20:53:14 2000\n" [2] [3]
2599652000-11-13Mirar (Pontus Hagland) http "Fri, 02 Jun 2000 19:53:14 GMT" [4]
30d57f2000-07-12Mirar (Pontus Hagland) time "2000-06-02 20:53:14" time_short "20000602 20:53:14" time_xshort "000602 20:53:14" mtime "2000-06-02 20:53" xtime "2000-06-02 20:53:14.000000" todz "20:53:14 CET" todz_iso "20:53:14 UTC+1" tod "20:53:14" tod_short "205314" xtod "20:53:14.000000" mod "20:53"
2599652000-11-13Mirar (Pontus Hagland) nice "2 Jun 20:53", "2 Jun 2000 20:53:14" [2][5] nicez "2 Jun 20:53 CET" [2][5] smtp "Fri, 2 Jun 2000 20:53:14 +0100" [6]
30d57f2000-07-12Mirar (Pontus Hagland) </pre> <tt>[1]</tt> note conflict (think 1 February 2003) <br/><tt>[2]</tt> language dependent <br/><tt>[3]</tt> as from the libc function ctime() <br/><tt>[4]</tt> as specified by the HTTP standard;
2599652000-11-13Mirar (Pontus Hagland)  this is always in GMT, ie, UTC. The timezone calculations needed will be executed implicitly. It is not language dependent. <br/><tt>[5]</tt> adaptive to type and with special cases for yesterday, tomorrow and other years <br/><tt>[6]</tt> as seen in Date: headers in mails</p>
30d57f2000-07-12Mirar (Pontus Hagland) </text> </doc> </docgroup> <class name='Fraction'> <doc> <text> <p>A Fraction is a part of a second, and/or a time period with higher resolution then a second.</p> <p>It contains everything that is possible to do with a <ref resolved='predef::Calendar.Time.Second'>Second</ref>, and also some methods of grabbing the time period with higher resolution. </p> </text> <group><note/><text> <p>Internally, the fraction time period is measured in nanoseconds. A shorter or more precise time period then in nanoseconds is not possible within the current Fraction class. </p> </text></group> </doc> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"unixtime"</value></argument><argument name='unixtime'><type> <or><int/><float/></or></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"unixtime"</value></argument><argument name='unixtime'><type> <or><int/><float/></or></type></argument> <argument name='len'><type> <or><int/><float/></or></type></argument> </arguments> </method><doc> <text> <p>It is possible to create a Fraction in two ways, either "now" with no arguments or from a unix time (as from <tt>time(2)</tt>).</p> <p>If created from unix time, both the start of the period and the size of the period can be given in floats, both representing seconds. Note that the default float precision in pike is rather low (same as 'float' in C, the 32 bit floating point precision, normally about 7 digits), so beware that the resolution might bite you. (Internally in a Fraction, the representation is an integer.)</p> <p>If created without explicit length, the fraction will always be of zero length.</p> </text> </doc> </docgroup> <docgroup homogen-name='TimeofDay' homogen-type='inherit'> <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> </docgroup> <docgroup homogen-name='now' homogen-type='method'> <method name='now'> <returntype> <object>TimeofDay </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Give the zero-length time period of the current time.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='set_ruleset'> <returntype> <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> <arguments><argument name='r'><type> <object>Ruleset</object></type></argument> </arguments> </method><method name='ruleset'> <returntype> <object>Ruleset </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Set or read the ruleset for the calendar. <ref resolved='predef::Calendar.Time.Fraction.set_ruleset'>set_ruleset</ref> returns a new calendar object, but with the new ruleset.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='set_timezone'> <returntype> <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> <arguments><argument name='tz'><type> <object resolved='predef::Calendar.Timezone'>Timezone</object></type></argument> </arguments> </method><method name='set_timezone'> <returntype> <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> <arguments><argument name='tz'><type> <or><string/><object resolved='predef::Calendar.Timezone'>Timezone</object></or></type></argument> </arguments> </method><method name='timezone'> <returntype> <object>TimeZone </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Set or get the current timezone (including dst) rule. <ref resolved='predef::Calendar.Time.Fraction.set_timezone'>set_timezone</ref> returns a new calendar object, as the called calendar but with another set of rules.</p> <p>Example: <pre> &gt; Calendar.now(); Result: Fraction(Fri 2 Jun 2000 18:03:22.010300 CET) &gt; Calendar.set_timezone(Calendar.Timezone.UTC)-&gt;now(); Result: Fraction(Fri 2 Jun 2000 16:03:02.323912 UTC) </pre></p> </text> </doc> </docgroup> </class> <class name='Hour'> <docgroup homogen-name='TimeofDay' homogen-type='inherit'> <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> </docgroup> </class> <class name='Minute'> <docgroup homogen-name='TimeofDay' homogen-type='inherit'> <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> </docgroup> </class> <class name='Second'> <docgroup homogen-name='TimeofDay' homogen-type='inherit'> <inherit name='TimeofDay'><classname>TimeofDay</classname></inherit> </docgroup> </class> <class name='SuperTimeRange'> <docgroup homogen-type='method'> <method name='second'> <returntype> <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> <arguments> </arguments> </method><method name='second'> <returntype> <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='seconds'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='seconds'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_seconds'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='minute'> <returntype> <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> <arguments> </arguments> </method><method name='minute'> <returntype> <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='minutes'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='minutes'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_minutes'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='hour'> <returntype> <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> <arguments> </arguments> </method><method name='hour'> <returntype> <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='hours'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='hours'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_hours'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Similar to <ref>TimeofDay</ref>, the Time::SuperTimeRange has a number of methods for digging out time parts of the range. Since a <ref resolved='predef::Calendar.Time.SuperTimeRange'>SuperTimeRange</ref> is a bit more complex - the major reason for its existance it that it contains holes, this calculation is a bit more advanced too.</p> <p>If a range contains the seconds, say, 1..2 and 4..5, the third second (number 2, since we start from 0) in the range would be number 4, like this:</p> <p><pre> no means this second 0 1 1 2 2 4 &lt;- second three is missing, 3 5 as we don't have it in the example range </pre></p> <p><ref resolved='predef::Calendar.Time.SuperTimeRange.number_of_seconds'>number_of_seconds</ref>() will in this example therefore also report 4, not 5, even if the time from start of the range to the end of the range is 5 seconds. </p> </text> </doc> </docgroup> <docgroup homogen-name='SuperTimeRange' homogen-type='inherit'> <inherit name='SuperTimeRange'><classname>TimeRanges.SuperTimeRange</classname></inherit> </docgroup> </class> <class name='TimeOfDay'> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='unixtime'><type><int/></type></argument> </arguments> </method><doc> <text> <p>In addition to the wide range of construction arguments for a normal TimeRange (see <ref resolved='predef::Calendar.TimeRange.create'>TimeRange.create</ref>), a time of day can also be constructed with unixtime as single argument consisting of the unix time - as returned from <tt>time(2)</tt> - of the time unit start.</p> <p>It can also be constructed without argument, which then means "now", as in "this minute".</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='hour_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='minute_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='second_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='fraction_no'> <returntype> <object>float </object></returntype> <arguments> </arguments> </method><doc> <text> <p>This gives back the number of the time unit, on this day. Fraction is a float number, 0&lt;=fraction&lt;1.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='hour'> <returntype> <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> <arguments> </arguments> </method><method name='hour'> <returntype> <object resolved='predef::Calendar.Time.Hour'>Hour </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='hours'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='hours'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Hour'>Hour</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_hours'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><doc> <text> <p> <ref resolved='predef::Calendar.Time.TimeOfDay.hour'>hour</ref>() gives back the timerange representing the first or <i>n</i>th Hour of the called object. Note that hours normally starts to count at zero, so <tt>-&gt;hour(2)</tt> gives the third hour within the range.</p> <p> An Hour is in the Calendar perspective as any other time range not only 60 minutes, but also one of the (normally) 24 hours of the day, precisely.</p> <p> <ref resolved='predef::Calendar.Time.TimeOfDay.hours'>hours</ref>() give back an array of all the hours containing the time periods called. With arguments, it will give back a range of those hours, in the same enumeration as the <i>n</i> to <ref resolved='predef::Calendar.Time.TimeOfDay.hour'>hour</ref>().</p> <p> <ref resolved='predef::Calendar.Time.TimeOfDay.number_of_hours'>number_of_hours</ref>() simple counts the number of hours containing the called time period.</p> <p>Note: The called object doesn't have to *fill* all the hours it will send back, it's enough if it exist in those hours:</p> <p> <pre> &gt; object h=Calendar.Time.Hour(); Result: Hour(265567) &gt; h-&gt;hours(); Result: ({ /* 1 element */ Hour(265567) }) &gt; h+=Calendar.Time.Minute(); Result: Minute(265567:01+60m) &gt; h-&gt;hours(); Result: ({ /* 2 elements */ Hour(265567), Hour(265568) }) </pre></p> </text> </doc> </docgroup> <docgroup homogen-name='TimeRange' homogen-type='inherit'> <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> </docgroup> <docgroup homogen-name='julian_day' homogen-type='method'> <method name='julian_day'> <returntype> <object>float </object></returntype> <arguments> </arguments> </method><doc> <text> <p>This calculates the corresponding julian day, from the time range. Note that the calculated day is the beginning of the period, and is a float - julian day standard says .00 is midday, 12:00 pm. </p> </text> <group><note/><text> <p>Normal pike (ie, 32 bit) floats (without --with-double-precision) has a limit of about 7 digits, and since we are about julian day 2500000, the precision on time of day is very limited.</p> </text></group> </doc> </docgroup> <docgroup homogen-type='method'> <method name='minute'> <returntype> <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> <arguments> </arguments> </method><method name='minute'> <returntype> <object resolved='predef::Calendar.Time.Minute'>Minute </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='minutes'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='minutes'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Minute'>Minute</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_minutes'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><doc> <text> <p><ref resolved='predef::Calendar.Time.TimeOfDay.minute'>minute</ref>() gives back the timerange representing the first or <i>n</i>th Minute of the called object. Note that minutes normally starts to count at zero, so <tt>-&gt;minute(2)</tt> gives the third minute within the range.</p> <p>An Minute is in the Calendar perspective as any other time range not only 60 seconds, but also one of the (normally) 60 minutes of the <ref resolved='predef::Calendar.Time.Hour'>Hour</ref>, precisely.</p> <p><ref resolved='predef::Calendar.Time.TimeOfDay.minutes'>minutes</ref>() give back an array of all the minutes containing the time periods called. With arguments, it will give back a range of those minutes, in the same enumeration as the <i>n</i> to <ref resolved='predef::Calendar.Time.TimeOfDay.minute'>minute</ref>().</p> <p><ref resolved='predef::Calendar.Time.TimeOfDay.number_of_minutes'>number_of_minutes</ref>() simple counts the number of minutes containing the called time period. </p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='move_seconds'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='seconds'><type><int/></type></argument> </arguments> </method><method name='move_ns'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='nanoseconds'><type><int/></type></argument> </arguments> </method><doc> <text> <p>These two methods gives back the time range called moved the specified amount of time, with the length intact.</p> <p>The motion is relative to the original position in time; 10 seconds ahead of 10:42:32 is 10:42:42, etc.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='second'> <returntype> <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> <arguments> </arguments> </method><method name='second'> <returntype> <object resolved='predef::Calendar.Time.Second'>Second </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='seconds'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='seconds'> <returntype> <array><valuetype> <object resolved='predef::Calendar.Time.Second'>Second</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_seconds'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><doc> <text> <p><ref resolved='predef::Calendar.Time.TimeOfDay.second'>second</ref>() gives back the timerange representing the first or <i>n</i>th Second of the called object. Note that seconds normally starts to count at zero, so <tt>-&gt;second(2)</tt> gives the third second within the range.</p> <p><ref resolved='predef::Calendar.Time.TimeOfDay.seconds'>seconds</ref>() give back an array of all the seconds containing the time periods called. With arguments, it will give back a range of those seconds, in the same enumeration as the <i>n</i> to <ref resolved='predef::Calendar.Time.TimeOfDay.second'>second</ref>().</p> <p><ref resolved='predef::Calendar.Time.TimeOfDay.number_of_seconds'>number_of_seconds</ref>() simple counts the number of seconds containing the called time period.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='set_size_seconds'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='seconds'><type><int/></type></argument> </arguments> </method><method name='set_size_ns'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='nanoseconds'><type><int/></type></argument> </arguments> </method><doc> <text> <p>These two methods allows the time range to be edited by size of specific units.</p> </text> </doc> </docgroup> <docgroup homogen-name='unix_time' homogen-type='method'> <method name='unix_time'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><doc> <text> <p>This calculates the corresponding unix time, - as returned from <tt>time(2)</tt> - from the time range. Note that the calculated unix time is the beginning of the period.</p> </text> </doc> </docgroup> </class> </module> <class name='TimeRange'> <doc> <text> <p>This is the base class for any time measurement and calendrar information. It defines all the things you can do with a time range, any time period.</p> <p>A TimeRange doubles as both a fixed period in time, and an amount of time. For instance, a week plus a day moves the week-period one day ahead (unaligning it with the week period, and thereby reducing it to just 7 days), no matter when in time the actual day were. </p> </text> </doc> <docgroup homogen-type='method'> <method name='`=='> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='compared_to'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='_equal'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='compared_to'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p> These two overloads the operator <tt>`==</tt> and the result of the <tt>equal</tt> function.</p> <p> a<tt>==</tt>b is considered true if the two timeranges are of the same type, have the same rules (language, timezone, etc) and are the same timerange.</p> <p> <tt>equal(</tt>a<tt>,</tt>b<tt>)</tt> are considered true if a and b are the same timerange, exactly the same as the <ref resolved='predef::Calendar.TimeRange.equals'>equals</ref> method.</p> <p> The <tt>__hash</tt> method is also present, to make timeranges possible to use as keys in mappings.</p> <p>known bugs: _equal is not currently possible to overload, due to wierd bugs, so equal uses `== for now.</p> </text> </doc> </docgroup> <docgroup homogen-name='`&amp;' homogen-type='method'>&amp; <method name='`&amp;'>&amp; <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='with'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p> Gives the cut on the called time period with another time period. The result is zero if the two periods doesn't overlap. <pre> &gt;- the past the future -&lt; |-------called-------| |-------other--------| &gt;----- cut -----&lt; </pre></p> </text> </doc> </docgroup> <docgroup homogen-name='`*' homogen-type='method'> <method name='`*'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><doc> <text> <p>This changes the amount of time in the time period. <tt>t*17</tt> is the same as doing <tt>t-&gt;<ref resolved='predef::Calendar.TimeRange.set_size'>set_size</ref>(t,17)</tt>.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='`+'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='`+'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='offset'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='`-'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='m'><type><int/></type></argument> </arguments> </method><method name='`-'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='x'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>This calculates the (promoted) time period either n step away or with a given offset. These functions does use <ref resolved='predef::Calendar.TimeRange.add'>add</ref> to really do the job: <pre> t+n t-&gt;add(n) t is a time period t-n t-&gt;add(-n) offset is a time period t+offset t-&gt;add(1,offset) n is an integer t-offset t-&gt;add(-1,offset) n+t t-&gt;add(n) n-t illegal offset+t offset-&gt;add(1,t) | note this! offset-t offset-&gt;add(-1,t) | </pre></p> <p>Mathematic rules: <pre> x+(t-x) == t x is an integer or a time period (x+t)-x == t t is a time period (t+x)-x == t o-(o-t) == t o is a time period t++ == t+1 t-- == t-1 </pre> </p> </text> <group><note/><text> <p>a-b does not give the distance between the start of a and b. Use the <ref resolved='predef::Calendar.TimeRange.distance'>distance</ref>() function to calculate that.</p> <p>The integer used to `+, `- and add are the <i>number</i> of steps the motion will be. It does <i>never</i> represent any <i>fixed</i> amount of time, like seconds or days.</p> </text></group> </doc> </docgroup> <docgroup homogen-type='method'> <method name='`/'> <returntype> <array><valuetype> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='split'> <returntype> <array><valuetype> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></valuetype></array></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><doc> <text> <p> This divides the called timerange into n pieces. The returned timerange type is not neccesarily of the same type as the called one.</p> <p>known bugs: These are currently not defined for <ref to='supertimerange'>supertimeranges</ref>.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='`/'> <returntype> <object>int </object></returntype> <arguments><argument name='with'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='how_many'> <returntype> <object>int </object></returntype> <arguments><argument name='with'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>This calculates how many instances of the given timerange has passed during the called timerange.</p> <p>For instance, to figure out your age, create the timerange of your lifespan, and divide with the instance of a <ref to='ymd.year'>Year</ref>.</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='`&lt;'>&lt; <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='compared_to'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='`&gt;'>&gt; <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='compared_to'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>These operators sorts roughty on the periods place in time. The major use might be to get multiset to work, besides sorting events clearly defined in time.</p> </text> </doc> </docgroup> <docgroup homogen-name='`^' homogen-type='method'> <method name='`^'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='with'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p> Gives the exclusive-or on the called time period and another time period, ie the union without the cut. The result is zero if the two periods were the same. <pre> &gt;- the past the future -&lt; |-------called-------| |-------other--------| &lt;----| |----&gt; - exclusive or </pre></p> </text> </doc> </docgroup> <docgroup homogen-name='`|' homogen-type='method'> <method name='`|'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='with'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p> Gives the union on the called time period and another time period. <pre> &gt;- the past the future -&lt; |-------called-------| |-------other--------| &lt;----------union----------&gt; </pre></p> </text> </doc> </docgroup> <docgroup homogen-name='add' homogen-type='method'> <method name='add'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='n'><type><int/></type></argument> <argument name='step'><type> <or><void/><object resolved='predef::Calendar.TimeRange'>TimeRange</object></or></type></argument> </arguments> </method><doc> <text> <p>calculates the (promoted) time period n steps away; if no step is given, the step's length is of the same length as the called time period.</p> <p>It is not recommended to loop by adding the increment time period to a shorter period; this can cause faults, if the shorter time period doesn't exist in the incremented period. (Like week 53, day 31 of a month or the leap day of a year.)</p> <p>Recommended use are like this: <pre> // loop over the 5th of the next 10 months TimeRange month=Month()+1; TimeRange orig_day=month()-&gt;day(5); for (int i=0; i&lt;10; i++) { month++; TimeRange day=month-&gt;place(orig_day); &lt;i&gt;...use day...&lt;/i&gt; } </pre></p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='beginning'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments> </arguments> </method><method name='end'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments> </arguments> </method><doc> <text> <p>This gives back the zero-sized beginning or end of the called time period.</p> <p>rule: <tt>range(t-&gt;beginning(),t-&gt;end())==t</tt></p> </text> </doc> </docgroup> <docgroup homogen-name='calendar' homogen-type='method'> <method name='calendar'> <returntype> <object resolved='predef::Calendar.Calendar'>Calendar </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Simply gives back the calendar in use, for instance Calendar.ISO or Calendar.Discordian. </p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='strictly_preceeds'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='preceeds'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='is_previous_to'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='overlaps'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='contains'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='equals'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='is_next_to'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='succeeds'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='strictly_succeeds'> <returntype> <int><min>0</min><max>1</max></int></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p> These methods exists to compare two periods of time on the timeline.</p> <p><pre> case predicates &lt;-- past future -&gt; |----A----| A strictly preceeds B, |----B----| A preceeds B |----A----| A strictly preceeds B, A preceeds B, |----B----| A is previous to B, A touches B |----A----| A preceeds B, |----B----| A overlaps B, A touches B |-------A-------| A preceeds B, A ends with B |----B----| A overlaps B, A contains B, A touches B, |-------A-------| A preceeds B, A succeeds B, |---B---| A overlaps B, A contains B, A touches B |----A----| A overlaps B, A touches B |----B----| A equals B, A starts with B, A ends with B |-------A-------| A succeeds B, A starts with B |----B----| A overlaps B, A contains B, A touches B |----A----| A succeeds B, |----B----| A overlaps B, A touches B |----A----| A strictly succeeds B, A succeeds B |----B----| A is next to B, A touches B |----A----| A strictly succeeds B, |----B----| A succeeds B </pre></p> </text> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='from'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>Create the timerange from another timerange.</p> <p>This is useful when converting objects from one calendar to another. Note that the ruleset will be transferred to the new object, so this method can't be used to convert between timezones or languges - use <ref resolved='predef::Calendar.TimeRange.set_timezone'>set_timezone</ref>, <ref resolved='predef::Calendar.TimeRange.set_language'>set_language</ref> or <ref resolved='predef::Calendar.TimeRange.set_ruleset'>set_ruleset</ref> to achieve this. </p> </text> <group><note/><text> <p>The size of the new object may be inexact; a Month object can't comprehend seconds, for instance.</p> </text></group> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> <or><int/><float/></or></type></argument> </arguments> </method><doc> <text> <p>Create the timerange from a julian day, the standardized method of counting days. If the timerange is more then a day, it will at least enclose the day. </p> </text> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"unix"</value></argument><argument name='unixtime'><type><int/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"unix"</value></argument><argument name='unixtime'><type><int/></type></argument> <argument name='seconds_len'><type><int/></type></argument> </arguments> </method><doc> <text> <p>Create the timerange from unix time (as given by <tt>time(2)</tt>), with eventually the size of the time range in the same unit, seconds. </p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='range'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='other'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='space'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='other'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='distance'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='other'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p> Derives different time periods in between the called timerange and the parameter timerange.</p> <p> <pre> &gt;- the past the future -&lt; |--called--| |--other--| &gt;------------ range -----------&lt; &gt;--space--&lt; &gt;----- distance -----&lt; </pre></p> <p> See also: add, TimeRanges.range, TimeRanges.space, TimeRanges.distance</p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='set_language'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='lang'><type> <object>Language</object></type></argument> </arguments> </method><method name='set_language'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='lang'><type><string/></type></argument> </arguments> </method><method name='language'> <returntype> <object>Language </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Set or get the current language rule.</p> </text>
6b1aeb2000-08-04Mirar (Pontus Hagland) </doc> </docgroup> <docgroup homogen-type='method'> <method name='next'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments> </arguments> </method><method name='prev'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Next and prev are compatible and convinience functions; <tt>a-&gt;next()</tt> is exactly the same as <tt>a+1</tt>; <tt>a=a-&gt;next()</tt> is <tt>a++</tt>.</p> </text>
9be4442000-08-14Mirar (Pontus Hagland) </doc> </docgroup> <docgroup homogen-name='offset_to' homogen-type='method'> <method name='offset_to'> <returntype> <object>int </object></returntype> <arguments><argument name='x'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>Calculates offset to x; this compares two timeranges and gives the integer offset between the two starting points.</p> <p>This is true for suitable a and b: <tt>a+a-&gt;offset_to(b)==b</tt></p> <p>By suitable means that a and b are of the same type and size. This is obviously true only if a+n has b as a possible result for any n.</p> </text>
30d57f2000-07-12Mirar (Pontus Hagland) </doc> </docgroup> <docgroup homogen-name='place' homogen-type='method'> <method name='place'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='this'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='place'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='this'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> <argument name='force'><type> <int><min>0</min><max>1</max></int></type></argument> </arguments> </method><doc> <text> <p>This will place the given timerange in this timerange, for instance, day 37 in the year - <tt>Year(1934)-&gt;place(Day(1948 d37)) =&gt; Day(1934 d37)</tt>. </p> </text> <group><note/><text> <p>The rules how to place things in different timeranges can be somewhat 'dwim'.</p> </text></group> </doc> </docgroup> <docgroup homogen-type='method'> <method name='set_ruleset'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='r'><type> <object>Ruleset</object></type></argument> </arguments> </method><method name='ruleset'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='r'><type> <object>Ruleset</object></type></argument> </arguments> </method><doc> <text> <p>Set or get the current ruleset.</p> </text> <group><note/><text> <p>this may include timezone shanges, and change the time of day.</p> </text></group> </doc> </docgroup> <docgroup homogen-name='set_size' homogen-type='method'> <method name='set_size'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='size'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><method name='set_size'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='n'><type><int/></type></argument> <argument name='size'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>Gives back a new (or the same, if the size matches) timerange with the new size. If <i>n</i> are given, the resulting size will be <i>n</i> amounts of the given size.</p> </text> <group><note/><text> <p>A negative size is not permitted; a zero one are.</p> </text></group> </doc> </docgroup> <docgroup homogen-type='method'> <method name='set_timezone'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='tz'><type> <object resolved='predef::Calendar.Timezone'>Timezone</object></type></argument> </arguments> </method><method name='set_timezone'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='tz'><type><string/></type></argument> </arguments> </method><method name='timezone'> <returntype> <object>TimeZone </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Set or get the current timezone (including dst) rule. </p> </text> <group><note/><text> <p>The time-of-day may very well change when you change timezone.</p> <p>To get the time of day for a specified timezone, select the timezone before getting the time of day:</p> <p><tt>Year(2003)-&gt;...-&gt;set_timezone(TimeZone.CET)-&gt;...-&gt;hour(14)-&gt;...</tt> </p> </text></group> </doc> </docgroup> <docgroup homogen-name='subtract' homogen-type='method'> <method name='subtract'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='what'><type> <object resolved='predef::Calendar.TimeRange'>TimeRange</object></type></argument> </arguments> </method><doc> <text> <p>This subtracts a period of time from another; <pre> &gt;- the past the future -&lt; |-------called-------| |-------other--------| &lt;----&gt; &lt;- called-&gt;subtract(other) |-------called-------| |---third---| &lt;----&gt; &lt;---&gt; &lt;- called-&gt;subtract(third) </pre></p> </text> </doc> </docgroup> </class> <module name='Timezone'> <doc> <text> <p> This module contains all the predefined timezones. Index it with whatever timezone you want to use.</p> <p>Example: <tt>Calendar.Calendar my_cal= Calendar.ISO-&gt;set_timezone(Calendar.Timezone["Europe/Stockholm"]); </tt></p> <p>A simpler way of selecting timezones might be to just give the string to <ref to='ruleset.set_timezone'>set_timezone</ref>; <ref to='ruleset.set_timezone'>it</ref> indexes by itself:</p> <p><tt>Calendar.Calendar my_cal= Calendar.ISO-&gt;set_timezone("Europe/Stockholm"); </tt> </p> </text> <group><note/><text> <p>Do not confuse this module with <ref>Ruleset.Timezone</ref>, which is the base class of a timezone object.</p> <p><tt>"CET"</tt> and some other standard abbreviations work too, but not all of them (due to more then one country using them).</p> <p>Do not call <ref to='calendar.time.set_timezone'>set_timezone</ref> too often, but remember the result if possible. It might take some time to initialize a timezone object.</p> <p>There are about 504 timezones with 127 different daylight saving rules. Most of them historic.</p> <p>The timezone information comes from <url href='ftp://elsie.nci.nih.gov/pub'>ftp://elsie.nci.nih.gov/pub/</url> and are not made up from scratch. Timezone bugs may be reported to the timezone mailing list, <url href='mailto:tz@elsie.nci.nih.gov'>tz@elsie.nci.nih.gov</url>, preferable with a <tt>cc</tt> to <url href='mailto:mirar@mirar.org'>mirar@mirar.org</url>. /Mirar </p> </text></group> <group><seealso/><text> <p><ref resolved='predef::Calendar.TZnames'>TZnames</ref>, <ref>Ruleset.Timezone</ref></p></text></group> </doc> <docgroup homogen-name='locale' homogen-type='constant'> <constant name='locale'><typevalue> <object>Ruleset.Timezone </object></typevalue> </constant><doc> <text> <p>This contains the local timezone, found from various parts of the system, if possible.</p> </text> </doc> </docgroup> <docgroup homogen-name='localtime' homogen-type='constant'> <constant name='localtime'><typevalue> <object>Ruleset.Timezone </object></typevalue> </constant><doc> <text> <p>This is a special timezone, that uses <ref resolved='predef::Calendar.Timezone.localtime'>localtime</ref>() and <ref>tzname</ref> to find out what current offset and timezone string to use.</p> <p><ref resolved='predef::Calendar.Timezone.locale'>locale</ref> uses this if there is no other way of finding a better timezone to use.</p> <p>This timezone is limited by <ref resolved='predef::Calendar.Timezone.localtime'>localtime</ref> and libc to the range of <tt>time_t</tt>, which is a MAXINT on most systems - 13 Dec 1901 20:45:52 to 19 Jan 2038 3:14:07, UTC.</p> </text> </doc> </docgroup> </module> <module name='YMD'> <doc> <text> <p> base for all Roman-kind of Calendars, ie, one with years, months, weeks and days </p> </text> </doc> <docgroup homogen-name='datetime' homogen-type='method'> <method name='datetime'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Replacement for localtime; gives back a mapping: <pre> ([ "year": int // year number (2000 AD=2000, 1 BC==0) "month": int(1..) // month of year "day": int(1..) // day of month "yearday": int(1..) // day of year "week": int(1..) // week of year "week_day": int(1..) // day of week (depending on calendar) "unix": int // unix time "julian": float // julian day "hour": int(0..) // hour of day, including dst "minute": int(0..59) // minute of hour "second": int(0..59) // second of minute "fraction": float // fraction of second "timezone": int // offset to utc, including dst ]); </pre> This is the same as calling <ref>Second</ref>()-&gt;<ref to='second.datetime'>datetime</ref>(). </p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='datetime_name'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><method name='datetime_short_name'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Compat functions; same as <ref resolved='predef::Calendar.YMD.format_iso'>format_iso</ref> and <ref resolved='predef::Calendar.YMD.format_iso_short'>format_iso_short</ref>. </p> </text> </doc> </docgroup> <docgroup homogen-name='dwim_day' homogen-type='method'> <method name='dwim_day'> <returntype> <object>Day </object></returntype> <arguments><argument name='date'><type><string/></type></argument> </arguments> </method><doc> <text> <p>Tries a number of different formats on the given date (in order): <pre> &lt;ref&gt;parse&lt;/ref&gt; format as in "%y-%M-%D (%M) -W%W-%e (%e)" "2000-03-20 (Mar) -W12-1 (Mon)"
c856482000-10-29Mirar (Pontus Hagland) "%M%/%D/%y" "3/20/2000"
30d57f2000-07-12Mirar (Pontus Hagland) "%D%*[ /]%M%*[ /-,]%y" "20/3/2000" "20 mar 2000" "20/3 -00" "%e%*[ ]%D%*[ /]%M%*[ /-,]%y" "Mon 20 Mar 2000" "Mon 20/3 2000" "%y-%M-%D" "2000-03-20", "00-03-20" "%d" "20000320", "000320" "-%y%*[ /]%D%*[ /]%M" "-00 20/3" "-00 20 mar" "-%y%*[ /]%M%*[ /]%D" "-00 3/20" "-00 march 20" "%y%*[ /]%D%*[ /]%M" "00 20 mar" "2000 20/3" "%y%*[ /]%M%*[ /]%D" "2000 march 20" "%D%*[ -/]%M" "20/3" "20 mar" "20-03" "%M%*[ -/]%D" "3/20" "march 20" "%e%*[ -/wv]%W%*[ -/]%y" "mon w12 -00" "1 w12 2000" "%e%*[ -/wv]%W" "mon w12" "%e" "monday" "1" "today" "today" "last %e" "last monday" "next %e" "next monday" </pre> </p> </text> <group><note/><text> <p>Casts exception if it fails to dwim out a day. "dwim" means do-what-i-mean. </p> </text></group> </doc> </docgroup> <docgroup homogen-type='method'> <method name='format_iso'> <returntype> <object>string </object></returntype> <arguments><argument name='unix_time'><type> <or><void/><int/></or></type></argument> </arguments> </method><method name='format_iso_short'> <returntype> <object>string </object></returntype> <arguments><argument name='unix_time'><type> <or><void/><int/></or></type></argument> </arguments> </method><method name='format_iso_tod'> <returntype> <object>string </object></returntype> <arguments><argument name='unix_time'><type> <or><void/><int/></or></type></argument> </arguments> </method><method name='format_day_iso'> <returntype> <object>string </object></returntype> <arguments><argument name='unix_time'><type> <or><void/><int/></or></type></argument> </arguments> </method><method name='format_day_iso_short'> <returntype> <object>string </object></returntype> <arguments><argument name='unix_time'><type> <or><void/><int/></or></type></argument> </arguments> </method><doc> <text> <p>Format the object into nice strings; <pre> iso "2000-06-02 (Jun) -W22-5 (Fri) 11:57:18 CEST" iso_short "2000-06-02 11:57:18" iso_tod "11:57:18" </pre></p> </text> </doc> </docgroup> <docgroup homogen-type='method'> <method name='format_iso_ymd'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_ymd'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_ymd_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_ymd_xshort'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_iso_week'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_iso_week_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_week'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_week_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_month'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_month_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_iso_time'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_time'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_time_short'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_time_xshort'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_mtime'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_xtime'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_tod'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_todz'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_xtod'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='format_mod'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><doc> <text> <p>Format the object into nice strings; <pre> iso_ymd "2000-06-02 (Jun) -W22-5 (Fri)" [2] ext_ymd "Friday, 2 June 2000" [2] ymd "2000-06-02" ymd_short "20000602" ymd_xshort "000602" [1] iso_week "2000-W22" iso_week_short "2000W22" week "2000-w22" [2] week_short "2000w22" [2] month "2000-06" month_short "200006" [1] iso_time "2000-06-02 (Jun) -W22-5 (Fri) 00:00:00 UTC+1" [2] ext_time "Friday, 2 June 2000, 00:00:00" [2] ctime "Fri Jun 2 00:00:00 2000\n" [2] [3] http "Fri, 02 Jun 2000 00:00:00 GMT" [4] time "2000-06-02 00:00:00" time_short "20000602 00:00:00" time_xshort "000602 00:00:00" mtime "2000-06-02 00:00" xtime "2000-06-02 00:00:00.000000" tod "00:00:00" tod_short "000000" todz "00:00:00 CET" todz_iso "00:00:00 UTC+1" xtod "00:00:00.000000" mod "00:00" </pre> <tt>[1]</tt> note conflict (think 1 February 2003) <br/><tt>[2]</tt> language dependent <br/><tt>[3]</tt> as from the libc function ctime() <br/><tt>[4]</tt> as specified by the HTTP standard; not language dependent.</p> </text> </doc> </docgroup>
93a0b32000-10-18Mirar (Pontus Hagland) <docgroup homogen-type='method'> <method name='second'> <returntype> <object>Second </object></returntype> <arguments> </arguments> </method><method name='second'> <returntype> <object>Second </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='minute'> <returntype> <object>Minute </object></returntype> <arguments><argument name='hour'><type><int/></type></argument> <argument name='minute'><type><int/></type></argument> <argument name='second'><type><int/></type></argument> </arguments> </method><method name='seconds'> <returntype> <array><valuetype> <object>Second</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='seconds'> <returntype> <array><valuetype> <object>Second</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_seconds'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='minute'> <returntype> <object>Minute </object></returntype> <arguments> </arguments> </method><method name='minute'> <returntype> <object>Minute </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='minute'> <returntype> <object>Minute </object></returntype> <arguments><argument name='hour'><type><int/></type></argument> <argument name='minute'><type><int/></type></argument> </arguments> </method><method name='minutes'> <returntype> <array><valuetype> <object>Minute</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='minutes'> <returntype> <array><valuetype> <object>Minute</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_minutes'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='hour'> <returntype> <object resolved='predef::Calendar.YMD.Hour'>Hour </object></returntype> <arguments> </arguments> </method><method name='hour'> <returntype> <object resolved='predef::Calendar.YMD.Hour'>Hour </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='hours'> <returntype> <array><valuetype> <object resolved='predef::Calendar.YMD.Hour'>Hour</object></valuetype></array></returntype> <arguments> </arguments> </method><method name='hours'> <returntype> <array><valuetype> <object resolved='predef::Calendar.YMD.Hour'>Hour</object></valuetype></array></returntype> <arguments><argument name='first'><type><int/></type></argument> <argument name='last'><type><int/></type></argument> </arguments> </method><method name='number_of_hours'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method></docgroup>
30d57f2000-07-12Mirar (Pontus Hagland) <class name='Hour'> <doc> <text> <p>global convinience functions</p> </text> </doc> <docgroup homogen-name='Hour' homogen-type='inherit'> <inherit name='Hour'><classname resolved='predef::Calendar.Time.Hour'>Time.Hour</classname></inherit> </docgroup> <docgroup homogen-name='YMD' homogen-type='inherit'> <inherit name='YMD'><classname resolved='predef::Calendar.YMD.YMD'>YMD</classname></inherit> </docgroup> <docgroup homogen-name='parse' homogen-type='method'> <method name='parse'> <returntype> <object resolved='predef::Calendar.TimeRange'>TimeRange </object></returntype> <arguments><argument name='fmt'><type><string/></type></argument> <argument name='arg'><type><string/></type></argument> </arguments> </method><doc> <text> <p>parse a date, create relevant object fmt is in the format "abc%xdef..." where abc and def is matched, and %x is one of those time units: <pre> %Y absolute year %y dwim year (70-99 is 1970-1999, 0-69 is 2000-2069) %M month (number, name or short name) (needs %y) %W week (needs %y) %D date (needs %y, %m) %d short date (20000304, 000304) %a day (needs %y) %e weekday (needs %y, %w) %h hour (needs %d, %D or %W) %m minute (needs %h) %s second (needs %m) %f fraction of a second (needs %s) %t short time (205314, 2053)
a9671d2000-08-04Mirar (Pontus Hagland) %z zone
a07ae72000-08-04Mirar (Pontus Hagland) %p "am" or "pm"
6850d12000-10-26Mirar (Pontus Hagland) %n empty string (to be put at the end of formats)
30d57f2000-07-12Mirar (Pontus Hagland) </pre> </p> </text>
a9671d2000-08-04Mirar (Pontus Hagland) <group><returns/><text> <p>0 if format doesn't match data, or the appropriate time object.</p> </text></group>
30d57f2000-07-12Mirar (Pontus Hagland) <group><note/><text>
a9671d2000-08-04Mirar (Pontus Hagland) <p>The zone will be a guess if it doesn't state an exact regional timezone (like "Europe/Stockholm") - most zone abbriviations (like "CET") are used by more then one region with it's own daylight saving rules. Also beware that for instance CST can be up to four different zones, central Australia or America being the most common.</p> <p><pre> Abbreviation Interpretation AMT America/Manaus [UTC-4] AST America/Curacao [UTC-4] CDT America/Costa_Rica [UTC-6] CST America/El Salvador [UTC-6] EST America/Panama [UTC-5] GST Asia/Dubai [UTC+4] IST Asia/Jerusalem [UTC+2] WST Australia/Perth [UTC+8] </pre></p>
7d4e8d2000-08-11Mirar (Pontus Hagland) <p>This mapping is modifiable in the ruleset, see <ref>Ruleset.set_abbr2zone</ref>.</p>
30d57f2000-07-12Mirar (Pontus Hagland) </text></group> </doc> </docgroup> </class> <class name='Week'> <doc> <text> <p>The Calendar week represents a standard time period of a week. In the Gregorian calendar, the standard week starts on a sunday and ends on a saturday; in the ISO calendar, it starts on a monday and ends on a sunday.</p> <p>The week are might not be aligned to the year, and thus the week may cross year borders and the year of the week might not be the same as the year of all the days in the week. The basic rule is that the week year is the year that has the most days in the week, but since week number only is specified in the ISO calendar - and derivates - the week number of most calendars is the week number of most of the days in the ISO calendar, which modifies this rule for the Gregorian calendar; the week number and year is the same as for the ISO calendar, except for the sundays.</p> <p>When adding, moving and subtracting months to a week, it falls back to using days.</p> <p>When adding, moving or subtracting years, if tries to place the moved week in the resulting year. </p> </text> </doc> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"unix"</value></argument><argument name='unix_time'><type><int/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> <or><int/><float/></or></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='year'><type><int/></type></argument> <argument name='week'><type><int/></type></argument> </arguments> </method><doc> <text> <p>It's possible to create the standard week by using three different methods; either the normal way - from standard unix time or the julian day, and also, for more practical use, from year and week number. </p> </text> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"unix"</value></argument><argument name='unix_time'><type><int/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> <or><int/><float/></or></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='year'><type><int/></type></argument> <argument name='month'><type><int/></type></argument> <argument name='day'><type><int/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='year'><type><int/></type></argument> <argument name='year_day'><type><int/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='julian_day'><type><int/></type></argument> </arguments> </method><doc> <text> <p>It's possible to create the day by using five different methods; either the normal way - from standard unix time or the julian day, and also, for more practical use, from year, month and day, from year and day of year, and from julian day without extra fuzz.</p> </text> </doc> </docgroup> <docgroup homogen-name='day' homogen-type='method'> <method name='day'> <returntype> <object>Day </object></returntype> <arguments> </arguments> </method><method name='day'> <returntype> <object>Day </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='day'> <returntype> <object>Day </object></returntype> <arguments><argument name='name'><type><string/></type></argument> </arguments> </method><doc> <text> <p>The Week type overloads the day() method, so it is possible to get a specified weekday by string:</p> <p><tt>week-&gt;day("sunday")</tt></p> <p>The integer and no argument behavior is inherited from <ref to='ymd.day'>YMD</ref>(). </p> </text> <group><note/><text> <p>the weekday-from-string routine is language dependent. </p> </text></group> </doc> </docgroup> </class> <class name='YMD'> <doc> <text> <p>Base (virtual) time period of the Roman-kind of calendar.</p> </text> </doc> <docgroup homogen-type='method'> <method name='fraction_no'> <returntype> <object>float </object></returntype> <arguments> </arguments> </method><method name='hour_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='julian_day'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='leap_year'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='minute_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='month_day'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='month_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='second_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='unix_time'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='utc_offset'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='week_day'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='week_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='year_day'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='year_no'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='month_name'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='month_shortname'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='month_day_name'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='week_day_name'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='week_day_shortname'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='week_name'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='year_name'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='tzname'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='tzname_iso'> <returntype> <object>string </object></returntype> <arguments> </arguments> </method><method name='datetime'> <returntype> <object>method </object></returntype> <arguments> </arguments> </method><doc> <text> <p>This gives back a mapping with the relevant time information (representing the start of the period); <pre> ([ "year": int // year number (2000 AD=2000, 1 BC==0) "month": int(1..) // month of year "day": int(1..) // day of month "yearday": int(0..) // day of year "week": int(1..) // week of year "week_day": int(0..) // day of week "timezone": int // offset to utc, including dst "unix": int // unix time "julian": int // julian day // for compatibility: "hour": 0 // hour of day, including dst "minute": 0 // minute of hour "second": 0 // second of minute "fraction": 0.0 // fraction of second ]); </pre> </p> </text> <group><note/><text> <p>Day of week is compatible with old versions, ie, 0 is sunday, 6 is saturday, so it shouldn't be used to calculate the day of the week with the given week number. Year day is also backwards compatible, ie, one (1) less then from the year_day() function.</p> </text></group> </doc> </docgroup> <docgroup homogen-name='TimeRange' homogen-type='inherit'> <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> </docgroup> </class> <class name='Year'> <doc> <text> <p>This is the time period of a year. </p> </text> </doc> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"unix"</value></argument><argument name='unix_time'><type><int/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument><value>"julian"</value></argument><argument name='julian_day'><type> <or><int/><float/></or></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='year'><type><int/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='year'><type><string/></type></argument> </arguments> </method><doc> <text> <p>It's possible to create the standard week by using three different methods; either the normal way - from standard unix time or the julian day, and also, for more practical use, from the year number. </p> </text> </doc> </docgroup> <docgroup homogen-name='TimeRange' homogen-type='inherit'> <inherit name='TimeRange'><classname resolved='predef::Calendar.TimeRange'>TimeRange</classname></inherit> </docgroup> <docgroup homogen-name='YMD' homogen-type='inherit'> <inherit name='YMD'><classname resolved='predef::Calendar.YMD.YMD'>YMD</classname></inherit> </docgroup> <docgroup homogen-name='month' homogen-type='method'> <method name='month'> <returntype> <object>Month </object></returntype> <arguments> </arguments> </method><method name='month'> <returntype> <object>Month </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='month'> <returntype> <object>Month </object></returntype> <arguments><argument name='name'><type><string/></type></argument> </arguments> </method><doc> <text> <p>The Year type overloads the month() method, so it is possible to get a specified month by string:</p> <p><tt>year-&gt;month("April")</tt></p> <p>The integer and no argument behavior is inherited from <ref to='ymd.month'>YMD</ref>().</p> </text> </doc> </docgroup> <docgroup homogen-name='week' homogen-type='method'> <method name='week'> <returntype> <object resolved='predef::Calendar.YMD.Week'>Week </object></returntype> <arguments> </arguments> </method><method name='week'> <returntype> <object resolved='predef::Calendar.YMD.Week'>Week </object></returntype> <arguments><argument name='n'><type><int/></type></argument> </arguments> </method><method name='week'> <returntype> <object resolved='predef::Calendar.YMD.Week'>Week </object></returntype> <arguments><argument name='name'><type><string/></type></argument> </arguments> </method><doc> <text> <p>The Year type overloads the week() method, so it is possible to get a specified week by name:</p> <p><tt>year-&gt;week("17")</tt> <tt>year-&gt;week("w17")</tt></p> <p>The integer and no argument behavior is inherited from <ref to='ymd.week'>YMD</ref>().</p> <p>This is useful, since the first week of a year not always (about half the years, in the ISO calendar) is numbered '1'. </p> </text> </doc> </docgroup> </class> </module> </module> <module name='Calendar_I'>
431c431998-12-31Fredrik Hübinette (Hubbe) <doc>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>
59beb42000-08-12Mirar (Pontus Hagland) This module exist only for backwards compatible issues with earlier Pike releases. Use the Calendar module instead.</p> <p>This code can be used to simulate the old calendar for now (it might be removed in later Pike's):</p> <p> <pre> #if constant(Calendar.II) #define Calendar Calendar_I #endif &lt;i&gt;...&lt;/i&gt; import Calendar &lt;i&gt;or whatever ...&lt;/i&gt; </pre></p> <p>This module implements calendar calculations, and base classes for time units.</p> <p/>
431c431998-12-31Fredrik Hübinette (Hubbe) </text>
6559661996-11-06Fredrik Hübinette (Hubbe) 
6665341999-11-23Mirar (Pontus Hagland) </doc> <module name='Gregorian'> <doc> <text> <p>time units:
30d57f2000-07-12Mirar (Pontus Hagland) <ref resolved='predef::Calendar_I.Gregorian.Year'>Year</ref>, <ref>Month</ref>, <ref>Week</ref>, <ref>Day</ref>
6665341999-11-23Mirar (Pontus Hagland) </p> </text>
6559661996-11-06Fredrik Hübinette (Hubbe) </doc>
46999f1999-02-13Fredrik Noring <docgroup homogen-name='datetime' homogen-type='method'> <method name='datetime'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Replacement for localtime. </p> </text> </doc> </docgroup> <docgroup homogen-name='datetime_name' homogen-type='method'> <method name='datetime_name'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Replacement for ctime. </p> </text> </doc> </docgroup> <docgroup homogen-name='datetime_short_name' homogen-type='method'> <method name='datetime_short_name'> <returntype><mixed/></returntype> <arguments><argument name='unix_time'><type> <or><int/><void/></or></type></argument> </arguments> </method><doc> <text> <p>Replacement for ctime. </p> </text> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe)  <class name='Year'> <doc>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
5f1f022000-08-04Martin Stjernholm <p>A <ref resolved='predef::Calendar_I.time_unit'>Calendar_I.time_unit</ref>.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Lesser units: <ref>Month</ref>, <ref>Week</ref>, <ref>Day</ref> Greater units: none</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p/> </text> </doc> <docgroup homogen-name='parse' homogen-type='method'> <method name='parse'> <returntype> <object>object </object></returntype> <arguments><argument name='fmt'><type><string/></type></argument> <argument name='arg'><type><string/></type></argument>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe)  </arguments> </method><doc> <text> <p>parse a date, create relevant object fmt is in the format "abc%xdef..." where abc and def is matched, and %x is one of those time units: %Y absolute year %y year (70-99 is 1970-1999, 0-69 is 2000-2069) %M month (number, name or short name) (needs %y) %W week (needs %y) %D date (needs %y, %m) %a day (needs %y) %e weekday (needs %y, %w) %h hour (needs %d, %D or %W) %m minute (needs %h)
6665341999-11-23Mirar (Pontus Hagland) %s second (needs %s) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </text>
6130721996-11-01Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) </class> </module> <module name='Stardate'> <doc>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>time unit: TNGDate</p> </text>
6130721996-11-01Fredrik Hübinette (Hubbe) 
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </doc>
431c431998-12-31Fredrik Hübinette (Hubbe) <class name='TNGDate'> <doc>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>implements ST:TNG stardates can be used as create argument to Day</p> </text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) </doc> </class> </module> <class name='time_unit'> <docgroup homogen-type='method'> <method name='next'> <returntype> <object>object </object></returntype> <arguments> </arguments> </method><method name='prev'> <returntype> <object>object </object></returntype> <arguments> </arguments> </method><method name='`+'> <returntype> <object>object </object></returntype> <arguments><argument name='n'><type><int/></type></argument>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe)  </arguments> </method><method name='`-'> <returntype> <object>object </object></returntype> <arguments><argument name='n'><type><int/></type></argument>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe)  </arguments> </method><method name='`-'> <returntype> <object>object </object></returntype>
30d57f2000-07-12Mirar (Pontus Hagland)  <arguments><argument name='x'><type><object resolved='predef::Calendar_I.time_unit.next'/></type></argument>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe)  </arguments> </method><doc> <text> <p>next and prev gives the logical next and previous object. The <tt>+</tt> operator gives that logical relative object, ie <tt>my_day+14</tt> gives 14 days ahead. <tt>-</tt> works the same way, but can also take an object
6665341999-11-23Mirar (Pontus Hagland) of the same type and give the difference as an integer.</p>
431c431998-12-31Fredrik Hübinette (Hubbe) </text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='greater' homogen-type='method'> <method name='greater'> <returntype> <array><valuetype><string/></valuetype></array></returntype> <arguments> </arguments> </method><doc>
6130721996-11-01Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Gives a list of methods to get greater (longer) time units from this object. For a month, this gives back <tt>({"year"})</tt>, thus the method <tt>month-&gt;year()</tt> gives the year object.
6130721996-11-01Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </text>
6559661996-11-06Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='lesser' homogen-type='method'> <method name='lesser'> <returntype> <array><valuetype><string/></valuetype></array></returntype> <arguments> </arguments> </method><doc>
6559661996-11-06Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Gives a list of methods to get lesser (shorter) time units. ie, for a month, this gives back <tt>({"day"})</tt> and the method <tt>day(mixed n)</tt> gives back that day object. The method <tt>days()</tt> gives back a list of possible argument values to the method <tt>day</tt>. Concurrently, <tt>Array.map(o-&gt;days(),o-&gt;day)</tt> gives a list of day objects in the object <tt>o</tt>.</p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p> Ie:<pre> array(string) lesser() - gives back a list of possible xxx's. object xxxs() - gives back a list of possible n's. object xxx(mixed n) - gives back xxx n object xxx(object(Xxx) o) - gives back the corresponing xxx </pre></p>
6559661996-11-06Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p>The list of n's (as returned from xxxs) are always in order.</p>
6130721996-11-01Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p>There are two n's with special meaning, 0 and -1. 0 always gives the first xxx, equal to my_obj-&gt;xxx(my_obj-&gt;xxxs()[0]), and -1 gives the last, equal to my_obj-&gt;xxx(my_obj-&gt;xxxs()[-1]).</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p>To get all xxxs in the object, do something like <tt>Array.map(my_obj-&gt;xxxs(),my_obj-&gt;xxx)</tt>.</p>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p>xxx(object) may return zero, if there was no correspondning xxx.
c3eeb11996-12-15Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </text>
c3eeb11996-12-15Fredrik Hübinette (Hubbe) 
6130721996-11-01Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) </class> </module>
29a5091999-08-25Henrik Grubbström (Grubba) <module name='Crypto'> <module name='randomness'> <doc> <text> <p>Assorted stronger or weaker randomnumber generators.</p> </text> </doc>
4a34462000-03-28Henrik Grubbström (Grubba) <class name='arcfour_random'>
29a5091999-08-25Henrik Grubbström (Grubba) <doc> <text>
4a34462000-03-28Henrik Grubbström (Grubba) <p>A pseudo random generator based on the arcfour crypto.</p>
29a5091999-08-25Henrik Grubbström (Grubba) </text> </doc>
4a34462000-03-28Henrik Grubbström (Grubba) <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='secret'><type><string/></type></argument> </arguments> </method><doc> <text> <p>Initialize and seed the arcfour random generator.</p> </text> </doc> </docgroup>
29a5091999-08-25Henrik Grubbström (Grubba) <docgroup homogen-name='read' homogen-type='method'> <method name='read'> <returntype> <object>string </object></returntype> <arguments><argument name='len'><type><int/></type></argument> </arguments> </method><doc> <text>
4a34462000-03-28Henrik Grubbström (Grubba) <p>Return a string of the next len random characters from the arcfour random generator.</p>
29a5091999-08-25Henrik Grubbström (Grubba) </text> </doc> </docgroup> </class>
4a34462000-03-28Henrik Grubbström (Grubba) <class name='pike_random'>
29a5091999-08-25Henrik Grubbström (Grubba) <doc> <text>
4a34462000-03-28Henrik Grubbström (Grubba) <p>A pseudo random generator based on the ordinary random() function.</p>
29a5091999-08-25Henrik Grubbström (Grubba) </text> </doc> <docgroup homogen-name='read' homogen-type='method'> <method name='read'> <returntype> <object>string </object></returntype> <arguments><argument name='len'><type><int/></type></argument> </arguments> </method><doc> <text>
4a34462000-03-28Henrik Grubbström (Grubba) <p>Returns a string of length len with pseudo random values.</p>
29a5091999-08-25Henrik Grubbström (Grubba) </text> </doc> </docgroup> </class> </module> </module>
fdfbe02000-11-21Johan Sundström <module name='Function'> <docgroup homogen-name='' homogen-type='import'> <import name=''><classname resolved='predef::'>predef::</classname></import> </docgroup> <docgroup homogen-name='splice_call' homogen-type='method'><doc><text><p>Calls the given function with the <tt>args</tt> array plus the optional extra arguments as its arguments and returns the result.</p> <p> Most useful in conjunction with <ref>map</ref>, and particularly in combination with <ref>sscanf</ref> with <tt>"...%{...%}..."</tt> scan strings (which indeed was what it was invented for in the first place).</p> </text><group><example/><text><p>class Product(string name, string version) { string _sprintf() { return sprintf("Product(%s/%s)", name, version); } } map(({ ({ "pike", "7.1.11" }), ({ "whitefish", "0.1" }) }), Function.splice_call, Product); ({ /* 2 elements */ Product(pike/7.1.11), Product(whitefish/0.1) })</p> </text></group></doc> <method name='splice_call'> <arguments><argument name='args'><type><array/></type></argument><argument name='f'><type><function/></type></argument><argument name='extra'><type><varargs><or><mixed/><void/></or></varargs></type></argument></arguments> <returntype><mixed/></returntype> </method> </docgroup> </module>
431c431998-12-31Fredrik Hübinette (Hubbe) <module name='Gdbm'> <class name='gdbm'>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>Gdbm.gdbm</tt> - database interface</p> <p>This is the an interface to the gdbm library. This module might or might not be available in your Pike depending on weather gdbm was available when Pike was compiled. </p> <p>A gdbm database has essentially the same functionality as a mapping, except the syntax is different, and it is located on disk, not in memory. Each gdbm database is one file which contains a set of key-value pairs. Both keys and values are strings and all keys are unique. </p> <p/> </text>
a44f221996-02-24Fredrik Hübinette (Hubbe)  </doc>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='close' homogen-type='method'> <method name='close'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>close</tt> - close database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void gdbm-&gt;close();<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>This closes the database.
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </text> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='create' homogen-type='method'> <method name='create'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>create</tt> - open database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int gdbm-&gt;create();<br/> or<br/> int gdbm-&gt;create(string <i>file</i>);<br/> or<br/> int gdbm-&gt;create(string <i>file</i>, string <i>mode</i>);<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>Without arguments, this function does nothing. With one argument it opens the given file as a gdbm database, if this fails for some reason, an error will be generated. If a second argument is present, it specifies how to open the database using one or more of the follow flags in a string:
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><matrix> <r><c> r </c><c> open database for reading </c></r> <r><c> w </c><c> open database for writing </c></r> <r><c> c </c><c> create database if it does not exist </c></r> <r><c> t </c><c> overwrite existing database </c></r> <r><c> f </c><c> fast mode </c></r> </matrix>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>The fast mode prevents the database from syncronizing each change in the database immediately. This is dangerous because the database can be left in an unusable state if Pike is terminated abnormally.
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>The default mode is "rwc".</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) </text>
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>The gdbm manual states that it is important that the database is closed properly. Unfortunately this will not be the case if Pike calls exit() or returns from main(). You should therefore make sure you call close or destruct your gdbm objects when exiting your program. This will probably be done automatically in the future.
563f981996-08-15Fredrik Hübinette (Hubbe) </p> <p/> </text></group>
a44f221996-02-24Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='delete' homogen-type='method'> <method name='delete'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>delete</tt> - delete a value from the database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int gdbm-&gt;delete(string <i>key</i>);<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>Remove a key from the database. Note that no error will be generated if the key does not exist.
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </text>
431c431998-12-31Fredrik Hübinette (Hubbe) </doc> </docgroup> <docgroup homogen-name='fetch' homogen-type='method'> <method name='fetch'> </method> <doc placeholder='true'> <text> <p><tt>fetch</tt> - fetch a value from the databse</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string gdbm-&gt;fetch(string <i>key</i>);<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>Return the data associated with the key 'key' in the database. If there was no such key in the database, zero is returned.
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p/> </text>
a44f221996-02-24Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='firstkey' homogen-type='method'> <method name='firstkey'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>firstkey</tt> - get first key in database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string gdbm-&gt;firstkey();<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>Return the first key in the database, this can be any key in the database. </p> <p/> </text>
a44f221996-02-24Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='nextkey' homogen-type='method'> <method name='nextkey'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>nextkey</tt> - get next key in database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string gdbm-&gt;nextkey(string <i>key</i>);<br/> </p> </tt> <p>This returns the key in database that follows the key 'key' key. This is of course used to iterate over all keys in the database.</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) </text> <group><example/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>/* Write the contents of the database */<br/> for(key=gdbm-&gt;firstkey(); k; k=gdbm-&gt;nextkey(k))<br/> <dl><group><text>write(k+":"+gdbm-&gt;fetch(k)+"\n");<br/> </text></group></dl> </p> <p><br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p> </tt></text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='reorganize' homogen-type='method'> <method name='reorganize'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>reorganize</tt> - reorganize database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int gdbm-&gt;reorganize();<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>Deletions and insertions into the database can cause fragmentation which will make the database bigger. This routine reorganizes the contents to get rid of fragmentation. Note however that this function can take a LOT of time to run.
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p/> </text>
a44f221996-02-24Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='store' homogen-type='method'> <method name='store'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>store</tt> - store a value in the database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int gdbm-&gt;store(string <i>key</i>, string <i>data</i>);<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>Associate the contents of 'data' with the key 'key'. If the key 'key' already exists in the database the data for that key will be replaced. If it does not exist it will be added. An error will be generated if the database was not open for writing. </p> <p/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </text> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='sync' homogen-type='method'> <method name='sync'> </method>
a44f221996-02-24Fredrik Hübinette (Hubbe) <doc placeholder='true'> <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>sync</tt> - synchronize database</p>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void gdbm-&gt;sync();<br/>
a44f221996-02-24Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) </tt> <p>When opening the database with the 'f' flag writings to the database can be cached in memory for a long time. Calling sync will write all such caches to disk and not return until everything is stored on the disk. </p> <p/> </text>
a44f221996-02-24Fredrik Hübinette (Hubbe) 
58cc772000-05-18Mirar (Pontus Hagland) </doc> </docgroup> </class> </module> <module name='Geographical'> <module name='Countries'> <doc> <text> <p>subclass Country</p> </text> </doc> <docgroup homogen-type='method'> <method name='`[]'> <returntype> <object>mixed </object></returntype> <arguments><argument name='what'><type><string/></type></argument> </arguments> </method><method name='`-&gt;'>&gt; <returntype> <object>mixed </object></returntype> <arguments><argument name='what'><type><string/></type></argument> </arguments> </method><doc> <text> <p> Convenience function for getting a country the name-space way; it looks up whatever it is in the name- and domain-space and <pre> &gt; Geographical.Countries.se; Result: Country(Sweden) &gt; Geographical.Countries.djibouti; Result: Country(Djibouti) &gt; Geographical.Countries.com; Result: Country(United States) &gt; Geographical.Countries.wallis_and_futuna_islands-&gt;iso2; Result: "WF" </pre></p> </text> <group><returns/><text> <p>that country if possible:</p> </text></group> </doc> </docgroup> <docgroup homogen-name='aka' homogen-type='variable'> <variable name='aka'><type> <array><valuetype><string/></valuetype></array></type> </variable><doc> <text> <p>Country name and as-known-as, if any</p> </text> </doc> </docgroup> <docgroup homogen-name='cast' homogen-type='method'> <method name='cast'> <returntype> <object>string </object></returntype> <arguments><argument><value>"string"</value></argument> </arguments> </method><doc> <text> <p>It is possible to cast a country to a string, which will be the same as performing <tt>country-&gt;name;</tt>.</p> </text> </doc> </docgroup> <docgroup homogen-name='countries' homogen-type='constant'> <constant name='countries'><typevalue> <array><valuetype> <object>Country</object></valuetype></array></typevalue> </constant><doc> <text> <p>All known countries.</p> </text> </doc> </docgroup> <docgroup homogen-name='former' homogen-type='variable'> <variable name='former'><type> <object>int </object></type> </variable><doc> <text> <p>Flag that is set if this isn't a country anymore (Like USSR.)</p> </text> </doc> </docgroup> <docgroup homogen-name='from_domain' homogen-type='method'> <method name='from_domain'> <returntype> <object>Country </object></returntype> <arguments><argument name='domain'><type><string/></type></argument> </arguments> </method><doc> <text> <p>Look up a country from a domain name. Returns zero if the domain doesn't map to a country. Note that there are some valid domains that doesn't: <dl compact='compact'> <dt>INT </dt><dd>International </dd><dt>MIL </dt><dd>US Military </dd><dt>NET </dt><dd>Network </dd><dt>ORG </dt><dd>Non-Profit Organization </dd><dt>ARPA </dt><dd>Old style Arpanet </dd><dt>NATO </dt><dd>Nato field </dd></dl></p> <p>And that USA has three domains, Great Britain two: <dl compact='compact'> <dt>COM </dt><dd>US Commercial </dd><dt>EDU </dt><dd>US Educational </dd><dt>GOV </dt><dd>US Government </dd><dt>GB </dt><dd>Great Britain (UK) </dd><dt>UK </dt><dd>United Kingdom </dd></dl></p> </text> </doc> </docgroup> <docgroup homogen-name='from_domain' homogen-type='method'> <method name='from_domain'> <returntype> <object>Country </object></returntype> <arguments><argument name='name'><type><string/></type></argument> </arguments> </method><doc> <text> <p>Look up a country from its name or aka. The search is case-insensitive but regards whitespace and interpunctation.</p> </text> </doc> </docgroup> <docgroup homogen-name='iso2' homogen-type='variable'> <variable name='iso2'><type> <object>string </object></type> </variable><doc> <text> <p>ISO 2-character code aka domain name</p> </text> </doc> </docgroup> <docgroup homogen-name='name' homogen-type='variable'> <variable name='name'><type> <object>string </object></type> </variable></docgroup> </module> <class name='Position'> <doc> <text> <p>This class contains a geographical position, ie a point on the earths surface. </p> </text> </doc> <docgroup homogen-type='method'> <method name='__hash'> <returntype> <object>int </object></returntype> <arguments> </arguments> </method><method name='`=='> <returntype> <object>int </object></returntype> <arguments><argument name='pos'><type> <object resolved='predef::Geographical.Position'>Position</object></type></argument> </arguments> </method><method name='`&lt;'>&lt; <returntype> <object>int </object></returntype> <arguments><argument name='pos'><type> <object resolved='predef::Geographical.Position'>Position</object></type></argument> </arguments> </method><method name='`&gt;'>&gt; <returntype> <object>int </object></returntype> <arguments><argument name='pos'><type> <object resolved='predef::Geographical.Position'>Position</object></type></argument> </arguments> </method><doc> <text> <p>These exist solely for purpose of detecting equal positions, for instance when used as keys in mappings.</p> </text> </doc> </docgroup> <docgroup homogen-name='cast' homogen-type='method'> <method name='cast'> <returntype> <object>array </object></returntype> <arguments><argument><value>"array"</value></argument> </arguments> </method><doc> <text> <p>It is possible to cast the position to an array, <tt>({float lat,float long})</tt>.</p> </text> </doc> </docgroup> <docgroup homogen-name='create' homogen-type='method'> <method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='lat'><type><float/></type></argument> <argument name='long'><type><float/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='lat'><type><string/></type></argument> <argument name='long'><type><string/></type></argument> </arguments> </method><method name='create'> <returntype> <object>void </object></returntype> <arguments><argument name='both'><type><string/></type></argument> </arguments> </method><doc> <text> <p>Constructor for this class. If feeded with strings, it will perform a dwim scan on the strings. If they fails to be understood, there will be an exception.</p> </text> </doc> </docgroup> <docgroup homogen-name='lat' homogen-type='variable'> <variable name='lat'><type> <object>float </object></type> </variable></docgroup> <docgroup homogen-type='method'> <method name='latitude'> <returntype> <object>string </object></returntype> <arguments><argument name='n'><type> <or><void/><int/></or></type></argument> </arguments> </method><method name='longitude'> <returntype> <object>string </object></returntype> <arguments><argument name='n'><type> <or><void/><int/></or></type></argument> </arguments> </method><doc> <text> <p>Returns the nicely formatted latitude or longitude. <pre> n format - 17°42.19'N 42°22.2'W 1 17.703°N 42.37°W 2 17°42.18'N 42°22.2'W 3 17°42'10.4"N 42°22'12"W -1 17.703 -42.37 </pre></p> </text> </doc> </docgroup> <docgroup homogen-name='long' homogen-type='variable'> <variable name='long'><type> <object>float </object></type> </variable><doc> <text> <p>Longitude (W--E) and latitude (N--S) of the position, float value in degrees. Positive number is north and east, respectively. Negative number is south and west, respectively.</p> </text>
a44f221996-02-24Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) </class> </module>
e76a112000-02-29David Hedbor <module name='Gettext'> <doc> <text> <p> This module enables access to localization functions from within Pike. </p> </text> </doc> <docgroup homogen-name='bindtextdomain' homogen-type='method'> <method name='bindtextdomain'> <returntype> <object>string </object></returntype> <arguments><argument name='domainname'><type> <or><string/><void/></or></type></argument> <argument name='string|voiddirname'><type> <object resolved='predef::Gettext.bindtextdomain'/></type></argument> </arguments> </method><doc> <text> <p>The bindtextdomain() function binds the path predicate for a message domain domainname to the value contained in dirname. If domainname is a non-empty string and has not been bound previously, bindtextdomain() binds domainname with dirname.</p> <p>If domainname is a non-empty string and has been bound previously, bindtextdomain() replaces the old binding with dirname. The dirname argument can be an absolute or relative pathname being resolved when gettext(), dgettext(), or dcgettext() are called. If domainname is null pointer or an empty string, bindtextdomain() returns 0. User defined domain names cannot begin with the string SYS_. Domain names beginning with this string are reserved for system use.</p> <p>The return value from bindtextdomain() is a string containing dirname or the directory binding associated with domainname if dirname is void. If no binding is found, the default locale path is returned. If domainname is void or an empty string, bindtextdomain() takes no action and returns a 0. </p> </text> <group> <param name='domainname'/> <text><p>The domain to query or bind a path to.</p></text></group> <group> <param name='dirname'/> <text><p>The directory name to bind to the choosen domain.</p></text></group> <group><seealso/><text> <p><ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> </doc> </docgroup> <docgroup homogen-name='dcgettext' homogen-type='method'> <method name='dcgettext'> <returntype> <object>string </object></returntype> <arguments><argument name='domain'><type><string/></type></argument> <argument name='stringmsg'><type> <object resolved='predef::Gettext.dcgettext'/></type></argument> <argument name='intcategory'><type> <object resolved='predef::Gettext.dcgettext'/></type></argument> </arguments> </method><doc> <text> <p>Return a translated version of msg within the context of the specified domain and current locale for the specified category. Calling dcgettext with category Locale.Gettext.LC_MESSAGES gives the same result as dgettext.</p> <p>If there is not translation available, msg is returned. </p> </text> <group> <param name='domain'/> <text><p>The domain to lookup the message in.</p></text></group> <group> <param name='msg'/> <text><p>The message to translate.</p></text></group> <group> <param name='category'/> <text><p>The category which locale should be used.</p></text></group> <group><seealso/><text> <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> </doc> </docgroup> <docgroup homogen-name='dgettext' homogen-type='method'> <method name='dgettext'> <returntype> <object>string </object></returntype> <arguments><argument name='domain'><type><string/></type></argument> <argument name='stringmsg'><type> <object resolved='predef::Gettext.dgettext'/></type></argument> </arguments> </method><doc> <text> <p>Return a translated version of msg within the context of the specified domain and current locale.</p> <p>If there is not translation available, msg is returned. </p> </text> <group> <param name='domain'/> <text><p>The domain to lookup the message in.</p></text></group> <group> <param name='msg'/> <text><p>The message to translate.</p></text></group> <group><seealso/><text> <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> </doc> </docgroup> <docgroup homogen-name='gettext' homogen-type='method'> <method name='gettext'> <returntype> <object>string </object></returntype> <arguments><argument name='msg'><type><string/></type></argument> </arguments> </method><doc> <text> <p>Return a translated version of msg within the context of the current domain and locale.</p> <p>If there is not translation available, msg is returned.</p> </text> <group> <param name='msg'/> <text><p>The message to translate.</p></text></group> <group><seealso/><text> <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> </doc> </docgroup> <docgroup homogen-name='localeconv' homogen-type='method'> <method name='localeconv'> <returntype> <object>mapping </object></returntype> <arguments> </arguments> </method><doc> <text> <p>The localeconv() function returns a mapping with settings for the current locale. This mapping contains all values associated with the locale categories LC_NUMERIC and LC_MONETARY.</p> <p><b>string decimal_point:</b> The decimal-point character used to format non-monetary quantities.</p> <p><b>string thousands_sep:</b> The character used to separate groups of digits to the left of the decimal-point character in formatted non-monetary quantities.</p> <p><b>string int_curr_symbol:</b> The international currency symbol applicable to the current locale, left-justified within a four-character space-padded field. The character sequences should match with those specified in ISO 4217 Codes for the Representation of Currency and Funds.</p> <p><b>string currency_symbol:</b> The local currency symbol applicable to the current locale.</p> <p><b>string mon_decimal_point:</b> The decimal point used to format monetary quantities.</p> <p><b>string mon_thousands_sep:</b> The separator for groups of digits to the left of the decimal point in formatted monetary quantities.</p> <p><b>string positive_sign:</b> The string used to indicate a non-negative-valued formatted monetary quantity.</p> <p><b>string negative_sign:</b> The string used to indicate a negative-valued formatted monetary quantity.</p> <p><b>int int_frac_digits:</b> The number of fractional digits (those to the right of the decimal point) to be displayed in an internationally formatted monetary quantity.</p> <p><b>int frac_digits:</b> The number of fractional digits (those to the right of the decimal point) to be displayed in a formatted monetary quantity.</p> <p><b>int p_cs_precedes:</b> Set to 1 or 0 if the currency_symbol respectively precedes or succeeds the value for a non-negative formatted monetary quantity.</p> <p><b>int p_sep_by_space:</b> Set to 1 or 0 if the currency_symbol respectively is or is not separated by a space from the value for a non-negative formatted monetary quantity.</p> <p><b>int n_cs_precedes:</b> Set to 1 or 0 if the currency_symbol respectively precedes or succeeds the value for a negative formatted monetary quantity.</p> <p><b>int n_sep_by_space:</b> Set to 1 or 0 if the currency_symbol respectively is or is not separated by a space from the value for a negative formatted monetary quantity.</p> <p><b>int p_sign_posn:</b> Set to a value indicating the positioning of the positive_sign for a non-negative formatted monetary quantity. The value of p_sign_posn is interpreted according to the following:</p> <p> 0 - Parentheses surround the quantity and currency_symbol.</p> <p> 1 - The sign string precedes the quantity and currency_symbol.</p> <p> 2 - The sign string succeeds the quantity and currency_symbol.</p> <p> 3 - The sign string immediately precedes the currency_symbol.</p> <p> 4 - The sign string immediately succeeds the currency_symbol.</p> <p><b>int n_sign_posn:</b> Set to a value indicating the positioning of the negative_sign for a negative formatted monetary quantity. The value of n_sign_posn is interpreted according to the rules described under p_sign_posn.</p> </text>
1a1f4c2000-02-29David Hedbor <group><seealso/><text> <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref></p></text></group>
e76a112000-02-29David Hedbor  </doc> </docgroup> <docgroup homogen-name='setlocale' homogen-type='method'> <method name='setlocale'> <returntype> <object>int </object></returntype> <arguments><argument name='category'><type><int/></type></argument> <argument name='stringlocale'><type> <object resolved='predef::Gettext.setlocale'/></type></argument> </arguments> </method><doc> <text> <p>The setlocale() function is used to set the program's current locale. If locale is "C" or "POSIX", the current locale is set to the portable locale.</p> <p>If locale is "", the locale is set to the default locale which is selected from the environment variable LANG.</p> <p>The argument category determines which functions are influenced by the new locale:</p> <p><b>Locale.Gettext.LC_ALL</b> for all of the locale.</p> <p><b>Locale.Gettext.LC_COLLATE</b> for the functions strcoll() and strxfrm() (used by pike, but not directly accessible).</p> <p><b>Locale.Gettext.LC_CTYPE</b> for the character classification and conversion routines.</p> <p><b>Locale.Gettext.LC_MONETARY</b> for localeconv().</p> <p><b>Locale.Gettext.LC_NUMERIC</b> for the decimal character.</p> <p><b>Locale.Gettext.LC_TIME</b> for strftime() (currently not accessible from Pike). </p> </text> <group> <param name='category'/> <text><p>The category in which to set the locale.</p></text></group> <group> <param name='locale'/> <text><p>The locale to change to</p></text></group> <group><returns/><text> <p>1 if the locale setting successed, 0 for failure</p> </text></group> <group><seealso/><text> <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> </doc> </docgroup> <docgroup homogen-name='textdomain' homogen-type='method'> <method name='textdomain'> <returntype> <object>string </object></returntype> <arguments><argument name='domain|void'><type><string/></type></argument> </arguments> </method><method name='textdomain'> <returntype> <object>string </object></returntype> <arguments><argument/> </arguments> </method><doc> <text> <p>The textdomain() function sets or queries the name of the current domain of the active LC_MESSAGES locale category. The domainname argument is a string that can contain only the characters allowed in legal filenames.</p> <p>The domainname argument is the unique name of a domain on the system. If there are multiple versions of the same domain on one system, namespace collisions can be avoided by using bindtextdomain(). If textdomain() is not called, a default domain is selected. The setting of domain made by the last valid call to textdomain() remains valid across subsequent calls to setlocale, and gettext().</p> <p>The normal return value from textdomain() is a string containing the current setting of the domain. If domainname is void, textdomain() returns a string containing the current domain. If textdomain() was not previously called and domainname is void, the name of the default domain is returned.</p> </text> <group> <param name='domainname'/> <text><p>The name of the domain to be made the current domain.</p></text></group> <group><seealso/><text> <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> </doc> </docgroup> </module>
431c431998-12-31Fredrik Hübinette (Hubbe) <module name='Gmp'> <class name='mpz'> <doc placeholder='true'>
94e6f41996-05-02Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>Gmp.mpz</tt> - bignum program</p>
94e6f41996-05-02Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Gmp.mpz is a builtin program written in C. It implements large, very large integers. In fact, the only limitation on these integers is the available memory.
94e6f41996-05-02Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>The mpz object implements all the normal integer operations. (except xor) There are also some extra operators:</p> </text>
94e6f41996-05-02Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>This module is only available if libgmp.a was available and found when Pike was compiled. </p> <p/>
94e6f41996-05-02Fredrik Hübinette (Hubbe) </text></group> </doc>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='cast' homogen-type='method'> <method name='cast'> </method> <doc placeholder='true'>
a1c5881995-08-09Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>cast</tt> - cast to other type</p>
d8215a1996-09-22Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>object mpz-&gt;gcd( "string" | "int" | "<i>float</i>" );<br/> or<br/> (string) mpz<br/> or<br/> (int) mpz<br/> or<br/> (float) mpz<br/>
a1c5881995-08-09Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function converts an mpz to a string, int or float. This is nessesary when you want to view, store or use the result of an mpz calculation.</p> </text>
3b8e841996-02-10Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref resolved='predef::Gmp.mpz.cast' to='cast'>cast</ref></p> </text></group>
a1c5881995-08-09Fredrik Hübinette (Hubbe) 
b06f481997-09-01Per Hedbor </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='create' homogen-type='method'> <method name='create'> </method> <doc placeholder='true'>
b06f481997-09-01Per Hedbor <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>create</tt> - initialize a bignum</p>
b06f481997-09-01Per Hedbor 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>object Mpz();<br/> or<br/> object Mpz(int|object|float <i>i</i>);<br/> or<br/> object Mpz(string <i>digits</i>, int <i>base</i>);<br/> <br/>
b06f481997-09-01Per Hedbor </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>When cloning an mpz it is by default initalized to zero. However, you can give a second argument to clone to initialize the new object to that value. The argument can be an int, float another mpz object, or a string containing an ascii number. You can also give the number in the string in another base by specifying the base as a second argument. Valid bases are 2-36 and 256.</p>
b06f481997-09-01Per Hedbor </text> <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='Builtin.clone'>Builtin.clone</ref></p>
b06f481997-09-01Per Hedbor </text></group>
3801711996-12-05Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='digits' homogen-type='method'> <method name='digits'> </method> <doc placeholder='true'>
3801711996-12-05Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>digits</tt> - convert mpz to a string</p>
3801711996-12-05Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string mpz-&gt;digits();<br/> or<br/> string mpz-&gt;digits(int <i>base</i>);<br/>
3801711996-12-05Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function converts an mpz to a string. If a base is given the number will be represented in that base. Valid bases are 2-36 and 256. The default base is 10.</p>
3801711996-12-05Fredrik Hübinette (Hubbe) </text> <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref resolved='predef::Gmp.mpz.cast' to='mpz-&gt;cast'>&gt;mpz-&gt;cast</ref></p>
3801711996-12-05Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='gcd' homogen-type='method'> <method name='gcd'> </method> <doc placeholder='true'>
3801711996-12-05Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>gcd</tt> - greatest common divisor</p>
3801711996-12-05Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>object mpz-&gt;gcd(object|int|float|string arg)<br/>
3801711996-12-05Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function returns the greatest common divisor for arg and mpz. </p> <p/>
3801711996-12-05Fredrik Hübinette (Hubbe) </text> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='powm' homogen-type='method'> <method name='powm'> </method> <doc placeholder='true'>
3801711996-12-05Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>powm</tt> - raise and modulo</p>
3801711996-12-05Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>object mpz-&gt;powm(int|string|float|object <i>a</i>,int|string|float|object <i>b</i>);<br/>
3801711996-12-05Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function returns ( mpz ** a ) % b </p> <p/>
3801711996-12-05Fredrik Hübinette (Hubbe) </text>
ab5bd41996-06-21Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='probably_prime_p' homogen-type='method'> <method name='probably_prime_p'> </method> <doc placeholder='true'>
ab5bd41996-06-21Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>probably_prime_p</tt> - is this number a prime?</p>
ab5bd41996-06-21Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>int mpz-&gt;probably_prime_p();<br/>
a1c5881995-08-09Fredrik Hübinette (Hubbe) </p>
ab5bd41996-06-21Fredrik Hübinette (Hubbe) </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function returns 1 if mpz is a prime, and 0 most of the time if it is not. </p> <p/> </text>
ab5bd41996-06-21Fredrik Hübinette (Hubbe) 
516e681996-02-26Fredrik Hübinette (Hubbe) </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='size' homogen-type='method'> <method name='size'> </method> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>size</tt> - how long is a number</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string mpz-&gt;size();<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) or<br/>
431c431998-12-31Fredrik Hübinette (Hubbe) string mpz-&gt;size(int <i>base</i>);<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function returns how long the mpz would be represented in the specified base. The default base is 2.</p> </text>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <group><seealso/><text> <p><ref resolved='predef::Gmp.mpz.digits' to='mpz-&gt;digits'>&gt;mpz-&gt;digits</ref></p> </text></group>
516e681996-02-26Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='sqrt' homogen-type='method'> <method name='sqrt'> </method> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>sqrt</tt> - square root</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>object mpz-&gt;sqrt();<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function return the the truncated integer part of the square root of the value of mpz. </p> <p/> </text>
516e681996-02-26Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) </class> </module> <class name='Gz_deflate'> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>Gz_deflate</tt> - gzip packer</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
bc9bc82000-01-17Andreas Sigfridsson <p>Gz_deflate is a builtin program written in C. It interfaces the
431c431998-12-31Fredrik Hübinette (Hubbe) packing routines in the libz library.</p>
516e681996-02-26Fredrik Hübinette (Hubbe) </text>
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>This program is only available if libz was available and found when Pike was compiled.</p> </text></group>
516e681996-02-26Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='gz_inflate'>gz_inflate</ref></p>
516e681996-02-26Fredrik Hübinette (Hubbe) </text></group> </doc>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='create' homogen-type='method'> <method name='create'> </method> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>create</tt> - initialize gzip packer</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void create(int X)<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) or<br/>
431c431998-12-31Fredrik Hübinette (Hubbe) object(Gz_deflate) Gz_deflate(int X)<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This functionion is called when a new Gz_deflate is created. If given, X should be a number from 0 to 9 indicating the packing / cpu ratio. Zero means no packing, 2-3 is considered 'fast', 6 is default and higher is considered 'slow' but gives better packing.
516e681996-02-26Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function can also be used to re-initialize a gz_deflate object so it can be re-used.
516e681996-02-26Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p/> </text>
516e681996-02-26Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='deflate' homogen-type='method'> <method name='deflate'> </method> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>deflate</tt> - pack data</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string deflate(string <i>data</i>, int <i>flush</i>);<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function preforms gzip style compression on a string and returns the packed data. Streaming can be done by calling this functon several time and concatenating the returned data. The optional 'flush' argument should be one f the following: </p> <p><matrix> <r><c> Gz_deflate-&gt;NO_FLUSH </c><c> Only data that doesn't fit in the </c></r> <r><c> </c></r> </matrix> <dl><group><text><matrix> <r><c> </c><c> internal buffers is returned. </c></r> <r><c> </c></r> </matrix> </text></group></dl><matrix> <r><c> Gz_deflate-&gt;PARTIAL_FLUSH </c><c> All input is packed and returned. </c></r> <r><c> Gz_deflate-&gt;SYNC_FLUSH </c><c> All input is packed and returned. </c></r> </matrix> <dl><group><text><matrix> <r><c> </c><c> Packing is syncronized. </c></r> <r><c> </c></r> </matrix> </text></group></dl><matrix> <r><c> Gz_deflate-&gt;FINISH </c><c> All input is packed and an 'end of </c></r> <r><c> </c><c> </c><c> </c><c> </c><c> data' marker is appended. </c></r>
516e681996-02-26Fredrik Hübinette (Hubbe) </matrix>
431c431998-12-31Fredrik Hübinette (Hubbe) 
516e681996-02-26Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Using flushing will degrade packing. Normally NO_FLUSH should be used until the end of the data when FINISH should be used. For interactive data PARTIAL_FLUSH should be used.</p> </text>
516e681996-02-26Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='gz_inflate-&gt;inflate'>&gt;gz_inflate-&gt;inflate</ref></p>
516e681996-02-26Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) </class> <class name='Gz_inflate'> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>Gz_inflate</tt> - gzip unpacker</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <p>Gz_inflate is a builtin program written in C. It interfaces the packing routines in the libz library.</p>
516e681996-02-26Fredrik Hübinette (Hubbe) </text>
431c431998-12-31Fredrik Hübinette (Hubbe) <group><note/><text> <p>This program is only available if libz was available and found when Pike was compiled.</p> </text></group>
516e681996-02-26Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='gz_deflate'>gz_deflate</ref></p>
516e681996-02-26Fredrik Hübinette (Hubbe) </text></group> </doc>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='create' homogen-type='method'> <method name='create'> </method> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>create</tt> - initialize gzip packer</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>void create()<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) or<br/>
431c431998-12-31Fredrik Hübinette (Hubbe) object(Gz_inflate) Gz_inflate()<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This functionion is called when a new Gz_inflate is created. It can also be called after the object has been used to re-initialize it.
516e681996-02-26Fredrik Hübinette (Hubbe) </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p/> </text>
516e681996-02-26Fredrik Hübinette (Hubbe)  </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) <docgroup homogen-name='inflate' homogen-type='method'> <method name='inflate'> </method> <doc placeholder='true'>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><tt>inflate</tt> - unpack data</p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>string inflate(string <i>data</i>);<br/>
516e681996-02-26Fredrik Hübinette (Hubbe) </p> </tt>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>This function preforms gzip style decompression. It can inflate a whole file at once or in blocks.</p>
516e681996-02-26Fredrik Hübinette (Hubbe) </text> <group><example/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <tt><p>#include &lt;stdio.h&gt;<br/> // whole file<br/> write(Gz_inflate()-&gt;inflate(stdin-&gt;read(0x7fffffff));<br/>
516e681996-02-26Fredrik Hübinette (Hubbe)  </p>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>// streaming (blocks)<br/> function inflate=Gz_inflate()-&gt;inflate;<br/> while(string s=stdin-&gt;read(8192))<br/> <dl><group><text>write(inflate(s));<br/> </text></group></dl></p> </tt></text></group>
516e681996-02-26Fredrik Hübinette (Hubbe)  <group><seealso/><text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p><ref to='gz_deflate-&gt;deflate'>&gt;gz_deflate-&gt;deflate</ref></p>
516e681996-02-26Fredrik Hübinette (Hubbe) </text></group> </doc> </docgroup>
431c431998-12-31Fredrik Hübinette (Hubbe) </class> <module name='Image'>
5561351999-03-01Henrik Wallin <doc> <group><note/><text> <p>Experimental functions.</p> </text></group> </doc>
bea55f1999-05-28Mirar (Pontus Hagland) <docgroup homogen-type='method'> <method name='load'> <returntype> <object resolved='predef::Image.Image'>Image.Image</object></returntype> <arguments> </arguments> </method><method name='load'> <returntype> <object resolved='predef::Image.Image'>Image.Image</object></returntype> <arguments><argument name='file'><type><object resolved='predef::Image.load'/></type></argument> </arguments> </method><method name='load'> <returntype> <object resolved='predef::Image.Image'>Image.Image</object></returntype> <arguments><argument name='filename'><type><string/></type></argument> </arguments> </method><method name='load_layer'> <returntype>
d71ce31999-08-12Mirar (Pontus Hagland)  <object resolved='predef::Image.Layer'>Image.Layer</object></returntype>
bea55f1999-05-28Mirar (Pontus Hagland)  <arguments> </arguments> </method><method name='load_layer'> <returntype>
d71ce31999-08-12Mirar (Pontus Hagland)  <object resolved='predef::Image.Layer'>Image.Layer</object></returntype>
bea55f1999-05-28Mirar (Pontus Hagland)  <arguments><argument name='file'><type><object resolved='predef::Image.load'/></type></argument> </arguments> </method><method name='load_layer'> <returntype>
d71ce31999-08-12Mirar (Pontus Hagland)  <object resolved='predef::Image.Layer'>Image.Layer</object></returntype>
bea55f1999-05-28Mirar (Pontus Hagland)  <arguments><argument name='filename'><type><string/></type></argument> </arguments> </method><method name='_load'> <returntype> <object>mapping </object></returntype> <arguments> </arguments> </method><method name='_load'> <returntype> <object>mapping </object></returntype> <arguments><argument name='file'><type><object resolved='predef::Image.load'/></type></argument> </arguments> </method><method name='_load'> <returntype> <object>mapping </object></returntype> <arguments><argument name='filename'><type><string/></type></argument> </arguments> </method><doc> <text> <p>Helper function to load an image from a file. If no filename is given, Stdio.stdin is used. The result is the same as from the decode functions in <ref resolved='predef::Image.ANY'>Image.ANY</ref>.</p> </text> <group><note/><text> <p>All data is read, ie nothing happens until the file is closed. Throws upon error.</p> </text></group>
d71ce31999-08-12Mirar (Pontus Hagland) </doc> </docgroup> <docgroup homogen-name='lay' homogen-type='method'> <method name='lay'> <returntype> <object resolved='predef::Image.Layer'>Image.Layer </object></returntype> <arguments><argument><value>array(Image.Layer|mapping)</value></argument> </arguments> </method><method name='lay'> <returntype> <object resolved='predef::Image.Layer'>Image.Layer </object></returntype> <arguments><argument><value>array(Image.Layer|mapping)</value></argument><argument name='xoffset'><type><int/></type></argument> <argument name='yoffset'><type><int/></type></argument> <argument name='xsize'><type><int/></type></argument> <argument name='ysize'><type><int/></type></argument> </arguments> </method><doc> <text> <p>Combine layers.</p> </text> <group><returns/><text> <p>a new layer object.</p> </text></group> <group><seealso/><text> <p><ref resolved='predef::Image.Layer'>Image.Layer</ref></p></text></group>
0946981999-04-17Mirar (Pontus Hagland) </doc> </docgroup>
44aff01999-02-24Mirar (Pontus Hagland) <module name='ANY'> <doc> <text> <p> This method calls the other decoding methods and has some heuristics for what type of image this is.</p> <p>Methods:
a4d12d1999-04-12Mirar (Pontus Hagland) <ref resolved='predef::Image.ANY.decode'>decode</ref>, <ref resolved='predef::Image.ANY.decode_alpha'>decode_alpha</ref>,
ec774b1999-04-09Mirar (Pontus Hagland) <ref resolved='predef::Image.ANY._decode'>_decode</ref></p>
44aff01999-02-24Mirar (Pontus Hagland)  <p/> </text> <group><seealso/><text>
1755091999-04-13Mirar (Pontus Hagland) <p><ref resolved='predef::Image.Image'>Image</ref></p></text></group>
44aff01999-02-24Mirar (Pontus Hagland)  </doc>
a4d12d1999-04-12Mirar (Pontus Hagland) <docgroup homogen-type='method'>
ec774b1999-04-09Mirar (Pontus Hagland) <method name='_decode'> <returntype> <object>mapping </object></returntype> <arguments><argument name='data'><type><string/></type></argument>
a4d12d1999-04-12Mirar (Pontus Hagland)  </arguments> </method><method name='decode'> <returntype> <object>object </object></returntype> <arguments><argument name='data'><type><string/></type></argument> </arguments> </method><method name='decode_alpha'> <returntype> <object>object </object></returntype> <arguments><argument name='data'><type><string/></type></argument>
ec774b1999-04-09Mirar (Pontus Hagland)  </arguments> </method><doc> <text> <p>Tries heuristics to find the correct method of decoding the data, then calls that method.</p> <p>The result of _decode() is a mapping that contains <pre> "type":image data type (ie, "image/jpeg" or similar) "image":the image object, "alpha":the alpha channel or 0 if N/A </pre> </p> </text> <group><note/><text> <p>Throws upon failure.</p> </text></group>
b1a60f1999-04-12Per Hedbor </doc> </docgroup> </module> <module name='AVS'> <docgroup homogen-type='method'> <method name='decode'> <returntype> <object>object </object></returntype> <arguments><argument name='data'><type><string/></type></argument> </arguments> </method><method name='_decode'> <returntype> <object>mapping </object></returntype> <arguments><argument name='data'><type><string/></type></argument> </arguments> </method><method name='encode'> <returntype> <object>string </object></returntype> <arguments><argument name='image'><type><object resolved='predef::Image.AVS.decode'/></type></argument> </arguments> </method><doc> <text> <p>Handle encoding and decoding of AVS-X images. AVS is rather trivial, and not really useful, but:</p> <p>An AVS file is a raw (uncompressed) 24 bit image file with alpha. The alpha channel is 8 bit, and there is no separate alpha for r, g and b.</p> </text>
ec774b1999-04-09Mirar (Pontus Hagland) </doc> </docgroup>
44aff01999-02-24Mirar (Pontus Hagland) </module>
120ee61999-03-22Mirar (Pontus Hagland) <module name='BMP'> <doc> <text> <p> This submodule keeps the BMP (Windows Bitmap)
1755091999-04-13Mirar (Pontus Hagland) encode/decode capabilities of the <ref resolved='predef::Image.Image'>Image</ref> module.</p>
120ee61999-03-22Mirar (Pontus Hagland)  <p>BMP is common in the Windows environment.</p> <p>Simple encoding:<br/>
a4d12d1999-04-12Mirar (Pontus Hagland) <ref resolved='predef::Image.BMP.encode'>encode</ref>
120ee61999-03-22Mirar (Pontus Hagland) </p> </text> <group><seealso/><text>
3250c11999-04-13Mirar (Pontus Hagland) <p><ref resolved='predef::Image.Image'>Image</ref>, <ref resolved='predef::Image.Image'>Image.Image</ref>, <ref resolved='predef::Image.Colortable'>Image.Colortable</ref></p></text></group>
120ee61999-03-22Mirar (Pontus Hagland)  </doc>
3885b91999-04-11Mirar (Pontus Hagland) <docgroup homogen-type='method'>
6dde141999-05-02Mirar (Pontus Hagland) <method name='decode'> <returntype> <object>object </object></returntype> <arguments><argument name='data'><type><string/></type></argument> </arguments> </method><method name='_decode'>
3885b91999-04-11Mirar (Pontus Hagland)  <returntype> <object>mapping </object></returntype> <arguments><argument name='data'><type><string/></type></argument> </arguments> </method><method name='decode_header'> <returntype> <object>mapping </object></returntype> <arguments><argument name='data'><type><string/></type></argument> </arguments> </method><method name='decode'> <returntype> <object>object </object></returntype> <arguments><argument name='data'><type><string/></type></argument>
6dde141999-05-02Mirar (Pontus Hagland) <argument name='options'><type><mapping/></type></argument>
3885b91999-04-11Mirar (Pontus Hagland) 
1d2f361999-05-02Mirar (Pontus Hagland)  </arguments> </method><method name='_decode'> <returntype> <object>mapping </object></returntype> <arguments><argument name='data'><type><string/></type></argument> <argument name='options'><type><mapping/></type></argument> </arguments> </method><method name='decode_header'> <returntype> <object>mapping </object></returntype> <arguments><argument name='data'><type><string/></type></argument> <argument name='options'><type><mapping/></type></argument>
3885b91999-04-11Mirar (Pontus Hagland)  </arguments> </method><doc> <text>
6dde141999-05-02Mirar (Pontus Hagland) <p>Decode a BMP.</p>
3885b91999-04-11Mirar (Pontus Hagland)  <p><ref resolved='predef::Image.BMP.decode'>decode</ref> gives an image object, <ref resolved='predef::Image.BMP._decode'>_decode</ref> gives a mapping in the format <pre> "type":"image/bmp", "image":image object, "colortable":colortable object (if applicable) "xsize":int, "ysize":int, "compression":int, "bpp":int, "windows":int, </pre></p> <p/> </text> <group><returns/><text> <p>the encoded image as a string</p> </text></group> <group><bugs/><text> <p>Doesn't support all BMP modes. At all.</p> </text></group> <group><seealso/><text> <p><ref resolved='predef::Image.BMP.encode'>encode</ref></p></text></group> </doc> </docgroup>
120ee61999-03-22Mirar (Pontus Hagland) <docgroup homogen-name='encode' homogen-type='method'> <method name='encode'> <returntype> <object>string </object></returntype> <arguments><argument name='image'><type><object resolved='predef::Image.BMP.encode'/></type></argument>
1b125a1999-05-03Mirar (Pontus Hagland)  </arguments> </method><method name='encode'> <returntype> <object>string </object></returntype> <arguments><argument name='image'><type><object resolved='predef::Image.BMP.encode'/></type></argument> <argument name='options'><type><mapping/></type></argument>
120ee61999-03-22Mirar (Pontus Hagland)  </arguments> </method><method name='encode'> <returntype> <object>string </object></returntype> <arguments><argument name='image'><type><object resolved='predef::Image.BMP.encode'/></type></argument> <argument name='colortable'><type><object resolved='predef::Image.BMP.encode'/></type></argument>
1b125a1999-05-03Mirar (Pontus Hagland)  </arguments> </method><method name='encode'> <returntype> <object>string </object></returntype> <arguments><argument name='image'><type><object resolved='predef::Image.BMP.encode'/></type></argument> <argument name='bpp'><type><int/></type></argument>
120ee61999-03-22Mirar (Pontus Hagland)  </arguments> </method><doc> <text> <p>Make a BMP. It default to a 24 bpp BMP file, but if a colortable is given, it will be 8bpp
1d2f361999-05-02Mirar (Pontus Hagland) with a palette entry.</p>
1b125a1999-05-03Mirar (Pontus Hagland) <p><tt>option</tt> is a mapping that may contain: <pre> "colortable": Image.Colortable - palette "bpp": 1|4|8|24 - force this many bits per pixel "rle": 0|1 - run-length encode (default is 0) </pre> </p>
120ee61999-03-22Mirar (Pontus Hagland) </text> <group> <param name='image'/> <text><p>Source image.</p></text></group> <group> <param name='colortable'/>
1d2f361999-05-02Mirar (Pontus Hagland) <text><p>Colortable object, shortcut for "colortable" in options.</p>
120ee61999-03-22Mirar (Pontus Hagland)  <p/></text></group> <group><returns/><text> <p>the encoded image as a string</p> </text></group> <group><bugs/><text>
1b125a1999-05-03Mirar (Pontus Hagland) <p>Doesn't support old BMP mode, only "windows" mode.</p>
120ee61999-03-22Mirar (Pontus Hagland) </text></group>
3885b91999-04-11Mirar (Pontus Hagland) <group><seealso/><text> <p><ref resolved='predef::Image.BMP.decode'>decode</ref></p></text></group>
120ee61999-03-22Mirar (Pontus Hagland)  </doc> </docgroup> </module>
3250c11999-04-13Mirar (Pontus Hagland) <module name='Color'>
431c431998-12-31Fredrik Hübinette (Hubbe) <doc>
516e681996-02-26Fredrik Hübinette (Hubbe) <text>
431c431998-12-31Fredrik Hübinette (Hubbe) <p>
91b4751999-06-15Mirar (Pontus Hagland)  This module keeps names and easy handling for easy color support. It gives you an easy way to get colors from names.</p> <p> A color is here an object, containing color information and methods for conversion, see below.</p> <p> <ref resolved='predef::Image.Color'>Image.Color</ref> can be called to make a color object. <ref resolved='predef::Image.Color'>Image.Color()</ref> takes the following arguments: <pre> Image.Color(string name) // "red" Image.Color(string prefix_string) // "lightblue" Image.Color(string hex_name) // "#ff00ff" Image.Color(string cmyk_string) // "%17,42,0,19.4" Image.Color(string hsv_string) // "%@327,90,32" Image.Color(int red, int green, int blue) </pre></p> <p> The color names available can be listed by using indices on Image.Color. The colors are available by name directly as <tt>Image.Color.name</tt>, too: <pre> ...Image.Color.red... ...Image.Color.green... or, maybe import Image.Color; ...red... ...green... ...lightgreen... </pre></p> <p> Giving red, green and blue values is equal to calling <ref resolved='predef::Image.Color.rgb'>Image.Color.rgb</ref>().</p> <p> The prefix_string method is a form for getting modified colors, it understands all modifiers (<ref to='image.color.color.light'>light</ref>, <ref to='image.color.color.dark'>dark</ref>, <ref to='image.color.color.bright'>bright</ref>, <ref to='image.color.color.dull'>dull</ref> and <ref to='image.color.color.neon'>neon</ref>). Simply use "method"+"color"; (as in <tt>lightgreen</tt>, <tt>dullmagenta</tt>, <tt>lightdullorange</tt>).</p> <p> The <tt>hex_name</tt> form is a simple <tt>#rrggbb</tt> form, as in HTML or X-program argument. A shorter form (<tt>#rgb</tt>) is also accepted. This is the inverse to the <ref resolved='predef::Image.Color.Color.hex'>Image.Color.Color-&gt;hex</ref>() method.</p> <p> The <tt>cmyk_string</tt> is a string form of giving <i>cmyk</i> (cyan, magenta, yellow, black) color. These values are floats representing percent.</p> <p> The <tt>hsv_string</tt> is another hue, saturation, value representation, but in floats; hue is in degree range (0..360), and saturation and value is given in percent. <i>This is not the same as returned or given to the <ref resolved='predef::Image.Color.hsv'>hsv</ref>() methods!</i></p>
516e681996-02-26Fredrik Hübinette (Hubbe) 
91b4751999-06-15Mirar (Pontus Hagland) <p>
1a56671999-07-23Mirar (Pontus Hagland) <add_appendix name='colors' title='image.color colors'><image file='predef.Image.Color.1.png' height='120' width='348'>colors.c.0.png</image><br/> <image file='predef.Image.Color.2.png' height='120' width='348'>colors.c.1.png</image><br/> <image file='predef.Image.Color.3.png' height='120' width='348'>colors.c.2.png</image><br/><image file='predef.Image.Color.4.png' height='120' width='348'>colors.c.3.png</image><br/><image file='predef.Image.Color.5.png' height='120' width='348'>colors.c.4.png</image><br/><image file='predef.Image.Color.6.png' height='120' width='348'>colors.c.5.png</image><br/><image file='predef.Image.Color.7.png' height='120' width='348'>colors.c.6.png</image><br/><image file='predef.Image.Color.8.png' height='120' width='348'>colors.c.7.png</image><br/><image file='predef.Image.Color.9.png' height='120' width='348'>colors.c