<div dir="ltr">Kevin,<br> this strings are not the problem, they will never be changed at runtime, but the application/function structure ast_app and ast_custom_function are now populated with the XML documentation at runtime (the description,synopsis and syntax) with dynamically allocated memory so they won't be anymore 'const' data.<br>
<br>ast_app {<br> const char *description;<br>}<br><br>is now<br><br>ast_app {<br> char *description;<br>}<br><br>So, we need to pass as a paramater a non-constant argument to ast_register_application().<br><br>Notice also that when finishing this proyect all this (const) descriptions will dissappear, and we will read all the documentation at runtime from the XMLs. <br>
<br>We have two paths to follow:<br>1) Stay with those strings as constant and do some casting to avoid WARNINGs when passing them to the ast_register_application (that was my previous commit). This casting is needed because ast_register_application is waiting a constant string too.<br>
<br>2) Stay with them like non constant strings, while the proyect is not complete.<br><br>I hope you understand why this was done... I dont know if it is the best way.<br><br>Thanks in advanced<br><br>Eliel<br><br><br><div class="gmail_quote">
On Fri, Aug 8, 2008 at 7:49 PM, Kevin P. Fleming <span dir="ltr"><<a href="mailto:kpfleming@digium.com">kpfleming@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
commits to the Asterisk project wrote:<br>
> Author: eliel<br>
> Date: Fri Aug 8 14:54:28 2008<br>
> New Revision: 136850<br>
><br>
> URL: <a href="http://svn.digium.com/view/asterisk?view=rev&rev=136850" target="_blank">http://svn.digium.com/view/asterisk?view=rev&rev=136850</a><br>
> Log:<br>
> Janitor (Move from 'static const char *' to 'static char *').<br>
><br>
> Now we have syntax, description and synopsis of every application/function defined as 'char *'. This is an attempt to<br>
> move every parameter in a register_application as custom_function_register to use 'char *' instead of 'const char *' when<br>
> referencing a 'description' or a 'synopsys'.<br>
><br>
> Also the casting made in ast_register_application2() to prevent WARNINGs was removed.<br>
<br>
Can someone explain why this was done? These strings are most definitely<br>
*NOT* to be modified at runtime, unless you can absolutely guarantee<br>
that they will never need extra storage. Even then, most of the usage of<br>
these strings does not make copies of them, so changing them after<br>
registration would be unacceptable.<br>
<br>
--<br>
Kevin P. Fleming<br>
Director of Software Technologies<br>
Digium, Inc. - "The Genuine Asterisk Experience" (TM)<br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank">http://www.api-digital.com--</a><br>
<br>
AstriCon 2008 - September 22 - 25 Phoenix, Arizona<br>
Register Now: <a href="http://www.astricon.net" target="_blank">http://www.astricon.net</a><br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Eliel Sardaņons<br>
</div>