<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><META http-equiv=Content-Type content="text/html; charset=utf-8"><META content="INBOX.COM" name=GENERATOR></HEAD>
<BODY>

<div>Hi everyone,</div><div><br></div><div>I'm a long time Delphi developer and I've just ported a few functions from the Geos C API</div><div>and I must say that I'm impressed from this library. So far I've been playing with the library</div><div>basic features. Now to the problem I've hit now. The message callback prototype...</div><div><br></div><div>We cannot implement <span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">GEOSMessageHandler callback in Delphi due to its </span>variadic <span style="font-size: 14.3999996185303px; line-height: 1.33;">parameter</span></div><div><span style="font-size: 14.3999996185303px; line-height: 1.33;">(the workarounds mentioned here http://stackoverflow.com/a/15051364/960757 </span><span style="font-size: 14.3999996185303px; line-height: 1.33;">are no good</span></div><div><span style="font-size: 14.3999996185303px; line-height: 1.33;">for me).</span></div><div><br></div><div>I see that the API is now in some stable state so I'm ready to modify it for my own <span style="font-size: 14.3999996185303px; line-height: 1.33;">purpose</span></div><div><span style="font-size: 14.3999996185303px; line-height: 1.33;">(though I would be very grateful for some </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">conditional </span><span style="font-size: 14.3999996185303px; line-height: 1.33;">change from your side). I can </span><span style="font-size: 14.3999996185303px; line-height: 1.33;">receive</span></div><div><span style="font-size: 14.3999996185303px; line-height: 1.33;">only the optional arguments e.g. as an array of strings in Delphi.</span></div><div><br></div><div><span style="font-size: 14.3999996185303px; line-height: 1.33;">Since there is at most 1 optional argument passed to the </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">variadic </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">parameter, I was thinking</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">about a simple prototype with two string parameters, but that would mean to modify quite a</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">big part of the </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">geos_ts_c.cpp file, and that's what I would like to avoid. Besides that, I don't</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">know if you'll use more than one optional argument in the future, so this is not the way to </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">go.</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><br></span></div><div><div style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">My question is, what would be the simplest way to modify the C API so that the callback</div><div style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">GEOSMessageHandler prototype would not use </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">variadic </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">parameter (...) but instead pass</span></div><div style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">the optional </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">arguments as an array of string? </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">I'm hoping in some "magical" template that</span></div><div style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">will do the </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">change in one place (sorry, I'm quite a C language noob).</span></div><div style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><br></span></div><div style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">Is there a way to easily "turn" the </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">GEOSMessageHandler prototype to be something like:</span></div></div><div style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><br></span></div><div>typedef void (*GEOSMessageHandler)(const char *fmt, int argc, <span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">const char **args</span><span style="font-size: 14.3999996185303px; line-height: 1.33;">);</span></div><div><span style="font-size: 14.3999996185303px; line-height: 1.33;"><br></span></div><div>Such callback I would be able to implement in Delphi, the one with the <span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">variadic </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">parameter</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">I cannot. And it seems to be the only thing that prevents me from using this library in Delphi</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">(yes, </span><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">I know, it's an ancient language :)</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><br></span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">Could you help me with this problem?</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;"><br></span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">Thank you</span></div><div><span style="font-size: 14.3999996185303px; line-height: 19.1520004272461px;">TLama</span></div>


<hr size="1px" noshade style="clear:both;margin-top:10px;height:1px;">
<div style="font:12px Verdana,sans-serif;color:Black;background:white;padding:3px;line-height:1.3em">
<span style="font-weight:bold;">Free Online Photosharing</span> - Share your photos online with your friends and family!<br>
Visit <a href="http://www.inbox.com/photosharing">http://www.inbox.com/photosharing</a> to find out more!</div>
</BODY>
</HTML>