<div class="gmail_quote">On Tue, Oct 25, 2011 at 00:33, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
This can be useful if you want to create a bunch of temporary strings<br>
with a common prefix. For example, when iterating over uniform<br>
structure fields, one might want to create temporary strings like<br>
"pallete.primary", "palette.outline", and "pallette.shadow".<br>
<br>
This could be done by overwriting the '.' with a null-byte and calling<br>
ralloc_asprintf_append, but that incurs the cost of strlen("pallete")<br>
every time...when this is already known.<br>
<br>
These new functions allow you rewrite the tail of the string, given a<br>
starting index. If the starting index is the length of the string, this<br>
is equivalent to appending.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br></blockquote><div><br>Looks useful, and removal of extra strlen is nice bonus.<br><br>Reviewed-By: Eugeni Dodonov <<a href="mailto:eugeni.dodonov@intel.com">eugeni.dodonov@intel.com</a>> <br>
<br></div></div>-- <br>Eugeni Dodonov<a href="http://eugeni.dodonov.net/" target="_blank"><br></a><br>