Branch: Tag:

1996-10-13

1996-10-13 15:14:01 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

speeded tuned_box, bugfixes, updated doc...

Rev: src/modules/image/doc/image.html:1.2
Rev: src/modules/image/font.c:1.5
Rev: src/modules/image/image.c:1.11

860:      </doc>   </docgroup> + <docgroup homogen-name='add_shared_strings' homogen-type='method'> + <method name='add_shared_strings'/><doc placeholder='true'> + <text> + <p><tt>add_shared_strings</tt> - add two pike strings</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *add_shared_strings(struct pike_string *a,<br/> + <dl><group><text>struct pike_string *b);<br/> + </text></group></dl></p> + </tt> + <p>This function builds the string a+b, that is the string a with the + string b appended to it. Note that the string returned will have + an extra reference.</p> +  + pike_string</text> +  + <group><seealso/><text> + <p><ref resolved='predef::begin_shared_string' to='begin_shared_string'>begin_shared_string</ref> and <ref to='make_shared_string'>make_shared_string</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='aggregage_list' homogen-type='method'>   <method name='aggregage_list'/><doc placeholder='true'>   <text>
1173:   <p>({<br/>   <dl><group><text><matrix>   <r><c> file, </c><c> /* a string with the filename if known, else zero */ </c></r> - <r><c> function, </c><c> /* The function-pointer to the called function */ </c></r> +    <r><c> line, </c><c> /* an integer containing the line if known, else zero */ </c></r> -  + <r><c> function, </c><c> /* The function-pointer to the called function */ </c></r>   </matrix>   </text></group></dl>})<br/>   
1189:      </doc>   </docgroup> + <docgroup homogen-name='begin_shared_string' homogen-type='method'> + <method name='begin_shared_string'/><doc placeholder='true'> + <text> + <p><tt>begin_shared_string</tt> - allocate space for a shared string</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *begin_shared_string(INT32 <i>len</i>);<br/> + </p> + </tt> + <p>This function allocates space for a shared string of length 'len'. + You should then MEMCPY 'len' bytes into the s-&gt;str. (s being the + returned value) And then call end_shared_string.</p> +  + pike_string</text> +  + <group><seealso/><text> + <p><ref resolved='predef::end_shared_string' to='end_shared_string'>end_shared_string</ref> and <ref to='make_shared_string'>make_shared_string</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='binary_findstring' homogen-type='method'> + <method name='binary_findstring'/><doc placeholder='true'> + <text> + <p><tt>binary_findstring</tt> - find a string</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *binary_findstring(char *<i>str</i>, INT32 <i>length</i>);<br/> + </p> + </tt> + <p>This function looks for the 'str' with length 'len' in the + global hash table. It returns the shared string if found, otherwise + zero. It does not increase/decrease the references to the string.</p> +  + pike_string</text> +  + <group><seealso/><text> + <p><ref resolved='predef::findstring' to='findstring'>findstring</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='break' homogen-type='method'>   <method name='break'/><doc placeholder='true'>   <text>
1764:      </doc>   </docgroup> + <docgroup homogen-name='end_shared_string' homogen-type='method'> + <method name='end_shared_string'/><doc placeholder='true'> + <text> + <p><tt>end_shared_string</tt> - link a shared string into the hashtable</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *end_shared_string(struct pike_string *<i>p</i>);<br/> + </p> + </tt> + <p>This function the prepared output from a begin_shared_string and + links the string into the hash table. If an identical string is + already present in the hash table, p is freed and that string is + returned instead. The returned string will have one extra reference + added.</p> + </text> +  + <group><example/><text> + <tt><p>#include "global.h"<br/> + #include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *mkcharstring(int ch)<br/> + {<br/> + <dl><group><text>struct pike_string *ret;<br/> + ret=begin_shared_string(1);<br/> + ret-&gt;str[0]=ch;<br/> + return end_shared_string(ret);<br/> + </text></group></dl>}<br/> + </p> + </tt> + pike_string</text></group> +  + <group><seealso/><text> + <p><ref resolved='predef::begin_shared_string' to='begin_shared_string'>begin_shared_string</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='equal' homogen-type='method'>   <method name='equal'/><doc placeholder='true'>   <text>
2096:      </doc>   </docgroup> + <docgroup homogen-name='findstring' homogen-type='method'> + <method name='findstring'/><doc placeholder='true'> + <text> + <p><tt>findstring</tt> - find a string</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *findstring(char *<i>str</i>);<br/> + </p> + </tt> + <p>This function looks for the null terminated C string 'str' in the + global hash table. It returns the shared string if found, otherwise + zero. It does not increase/decrease the references to the string.</p> +  + pike_string</text> +  + <group><seealso/><text> + <p><ref to='make_shared_string'>make_shared_string</ref> and <ref resolved='predef::binary_findstring' to='binary_findstring'>binary_findstring</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='float' homogen-type='method'>   <method name='float'/><doc placeholder='true'>   <text>
2260:      </doc>   </docgroup> + <docgroup homogen-name='free_string' homogen-type='method'> + <method name='free_string'/><doc placeholder='true'> + <text> + <p><tt>free_string</tt> - free a pike string</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>void free_string(struct pike_string *p)<br/> + </p> + </tt> + <p>This function frees the string 'p'. What it actually does is that it + decreases the reference count of 'p' and frees the memory reserved + for it if the refereneces reach zero.</p> + </text> +  + <group><note/><text> + <p>free_string is actually a macro</p> +  + pike_string</text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='function' homogen-type='method'>   <method name='function'/><doc placeholder='true'>   <text>
3260:      </doc>   </docgroup> + <docgroup homogen-name='make_shared_binary_string' homogen-type='method'> + <method name='make_shared_binary_string'/><doc placeholder='true'> + <text> + <p><tt>make_shared_binary_string</tt> - make a shared string</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *make_shared_binary_string(const char *<i>str</i>, int <i>len</i>);<br/> + </p> + </tt> + <p>This function makes a shared string from the memory area beginning + at 'str' and ends at str+len. The returned string will have one + extra reference.</p> +  + pike_string</text> +  + <group><seealso/><text> + <p><ref to='make_shared_string'>make_shared_string</ref>, <ref resolved='predef::begin_shared_string' to='begin_shared_string'>begin_shared_string</ref>, <ref resolved='predef::push_string' to='push_string'>push_string</ref> and <ref resolved='predef::free_string' to='free_string'>free_string</ref></p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='make_shared_binary_string' homogen-type='method'> + <method name='make_shared_binary_string'/><doc placeholder='true'> + <text> + <p><tt>make_shared_binary_string</tt> - make a shared string</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *make_shared_string(const char *<i>str</i>);<br/> + </p> + </tt> + <p>This function does the same thing as make_shared_binary_string, but + expects a zero terminated string instead.</p> +  + pike_string</text> +  + <group><seealso/><text> + <p><ref resolved='predef::make_shared_binary_string' to='make_shared_binary_string'>make_shared_binary_string</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='map' homogen-type='method'>   <method name='map'/><doc placeholder='true'>   <text>
3620:      </doc>   </docgroup> + <docgroup homogen-name='my_strcmp' homogen-type='method'> + <method name='my_strcmp'/><doc placeholder='true'> + <text> + <p><tt>my_strcmp</tt> - my own strcmp function</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>int my_strcmp(struct pike_string *a, struct pike_string *b)<br/> + </p> + </tt> + <p>This function compares two pike strings and takes locales into + account if the system supports locales. It returns zero if the + strings are the same, a number greater than zero zero if 'a' + is greater than 'b', and a number below zero otherwise.</p> +  + pike_string</text> +  + <group><seealso/><text> + <p><ref to='make_shared_string'>make_shared_string</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='next_object' homogen-type='method'>   <method name='next_object'/><doc placeholder='true'>   <text>
3857:      </doc>   </docgroup> + <docgroup homogen-name='pike_string' homogen-type='method'> + <method name='pike_string'/><doc placeholder='true'> + <text> + <p><tt>pike_string</tt> - internal pike shared strings</p> +  + <p>This is the internal type for representing pike strings. They have + ref counts and they are shared though a global hash table. The C + type is a struct pike_string that has two public members: str and + len. str is an array of char which contain the actual string. It + is guaranteed that the string is null terminated, but the string + can also contain zeroes before the end. len is of course the + length of the string. Since strings are shared you may _never_ + modify the contents of a string, except for adding/subtracting + references when approperiate. The only exception to this is when + creating a new shared string with begin_shared_string which has + not yet been linked to the hash table with end_shared_string.</p> +  + internals</text> +  + </doc> + </docgroup>   <docgroup homogen-name='popen' homogen-type='method'>   <method name='popen'/><doc placeholder='true'>   <text>
3958:      </doc>   </docgroup> + <docgroup homogen-name='push_string' homogen-type='method'> + <method name='push_string'/><doc placeholder='true'> + <text> + <p><tt>push_string</tt> - push a string on the pike stack</p> +  + <tt><p>#include "interpret.h"<br/> +  + </p> + <p>void push_string(struct pike_string *p)<br/> + </p> + </tt> + <p><matrix> + <r><c> This function pushes the string p on the pike stack. Note that this </c></r> + <r><c> function does _not_ add any extra references to 'p'. Most functions </c></r> + <r><c> that create shared strings give one extra reference to them though. </c></r> + <r><c> If you get your string from a function that does not add extra </c><c> </c></r> + <r><c> references you will have to add a reference manually. </c></r> + </matrix> + </p> + </text> +  + <group><note/><text> + <p>push_string is actually a macro</p> +  + pike_string</text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='putenv' homogen-type='method'>   <method name='putenv'/><doc placeholder='true'>   <text>
4983:      </doc>   </docgroup> + <docgroup homogen-name='string_replace' homogen-type='method'> + <method name='string_replace'/><doc placeholder='true'> + <text> + <p><tt>string_replace</tt> - do string replacements</p> +  + <tt><p>#include "stralloc.h"<br/> +  + </p> + <p>struct pike_string *string_replace(struct pike_string *str,<br/> + <dl><group><text>struct pike_string *from,<br/> + struct pike_string *to);<br/> + </text></group></dl></p> + </tt> + <p>This function builds a new string from 'str' with all occurances + of 'from' replaced by 'to'. Note that the new string will have one + extra reference.</p> +  + pike_string</text> +  + </doc> + </docgroup>   <docgroup homogen-name='stringp' homogen-type='method'>   <method name='stringp'/><doc placeholder='true'>   <text>
7270:   </doc>   </docgroup>   </class> + <class name='/precompiled/string_buffer'> + <doc placeholder='true'> + <text> + <p><tt>/precompiled/string_buffer</tt> - incremental string buffer</p> +  + <p>string_buffer implements a fast way to build strings by appending + strings or chars to the end of the buffer.</p> + </text> +  + <group><bugs/><text> + <p>This object is not thread-safe, if several threads access the same + buffer they have to protect the accesses with mutex locks. + </p> + <p/> + </text></group> +  + </doc> + <docgroup homogen-name='append' homogen-type='method'> + <method name='append'> + </method> + <doc placeholder='true'> + <text> + <p><tt>append</tt> - append a string to the buffer</p> +  + <tt><p>#include &lt;string.h&gt;<br/> +  + </p> + <p>void string_buffer-&gt;append(string <i>s</i>);<br/> + </p> + </tt> + <p>This function appends the string s to the end of the buffer. + </p> + <p/> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='flush' homogen-type='method'> + <method name='flush'> + </method> + <doc placeholder='true'> + <text> + <p><tt>flush</tt> - flush the contents of the buffer</p> +  + <tt><p>#include &lt;string.h&gt;<br/> +  + </p> + <p>void string_buffer-&gt;flush();<br/> + </p> + </tt> + <p>This function empties the string buffer. You don't need to call this + function if you use the string buffer only once since the start + state for a string buffer is flushed. + </p> + <p/> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='get_buffer' homogen-type='method'> + <method name='get_buffer'> + </method> + <doc placeholder='true'> + <text> + <p><tt>get_buffer</tt> - get the contents of the buffer as a string.</p> +  + <tt><p>#include &lt;string.h&gt;<br/> +  + </p> + <p>mixed string_buffer-&gt;get_buffer();<br/> + or<br/> + (string)string_buffer;<br/> + </p> + </tt> + <p>This function retreives the content of the buffer. Note that it does + not clear the contents of the buffer. You have to do that yourself + with create(). + </p> + <p/> + </text> +  + </doc> + </docgroup> + </class>   </namespace>   </autodoc>