<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey John,<div><br></div><div>Thanks for implementing this...I'm going to integrate the patch now.</div><div><br></div><div>snaroff</div><div><br><div><div>On Nov 6, 2009, at 10:18 PM, John Thompson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Sorry, I forgot to hit the save button after editing out some other changes from the patch.  Here's the corrected version.<br><br> <div class="gmail_quote">On Fri, Nov 6, 2009 at 5:29 PM, John Thompson <span dir="ltr"><<a href="mailto:john.thompson.jtsoftware@gmail.com">john.thompson.jtsoftware@gmail.com</a>></span> wrote:<br> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"> <div>Here's my stab at the CXString conversion.</div> <div> </div> <div>I also moved getLocationFromCursor to fix a compiler warning.<br></div><font color="#888888"> <div>-John<br></div></font> <div> <div></div> <div class="h5"> <div class="gmail_quote">On Fri, Nov 6, 2009 at 3:27 PM, John Thompson <span dir="ltr"><<a href="mailto:john.thompson.jtsoftware@gmail.com" target="_blank">john.thompson.jtsoftware@gmail.com</a>></span> wrote:<br> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"> <div>Sure, I'll take a crack at it.</div> <div> </div> <div>-John<br><br></div> <div> <div></div> <div> <div class="gmail_quote">On Fri, Nov 6, 2009 at 11:14 AM, steve naroff <span dir="ltr"><<a href="mailto:snaroff@apple.com" target="_blank">snaroff@apple.com</a>></span> wrote:<br> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi John,<br><br>I just spoke with Doug about this and we came up with the following proposal...<br><br>The following API would now return a CXString;<br> <br>CINDEX_LINKAGE CXString clang_getDeclSpelling(CXDecl);<br><br>The interface to CXString would be:<br><br>const char *clang_getCString(CXString);<br>void clang_disposeString(CXString); /* client must always call this when it no longer needs the string */<br> <br>The implementation of CXString would be:<br><br>/* Note that both of these slots are effectively 'private' */<br>typedef struct {<br> const char *Spelling;<br> /* A 1 value indicates the clang_ indexing API needed to allocate the string (and it must be freed by clang_disposeString()). */<br>  int MustFreeString;<br>} CXString;<br><br>The benefit of this abstraction is we can use it in other places if necessary (when dealing with string lifetime issues that cross the C/C++ language barrier).<br><br>What do you (or others interested in this) think? From my perspective, it seems cleaner than the other proposals that have been discussed.<br> <br>If we can agree on the change, are you interested in making this change?<br><br>Thanks much,<br><br>snaroff<br><br><br><br><br></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>John Thompson<br> <a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br></font></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br> <br></div></div></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br> <span><CXString.patch></span>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></body></html>