<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Jul 5, 2011 at 17:45, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="word-wrap:break-word"><div class="im"><br><div><div>On Jul 3, 2011, at 8:16 PM, Eli Bendersky wrote:</div><br><blockquote type="cite"><div dir="ltr">| We'll happily commit patches to keep the Python bindings working. <div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF">

<div><br></div><div>  - Doug</div></div></blockquote><div><br>I'm attaching a patch (diffed against trunk) with some fixes to the Python bindings, making its tests pass again (on Linux and Windows).<br><br>Some details of the patch:<br>



<br>* Implemented a new function in libclang: clang_isAttr - it is similar to existing clang_Is* functions. Also exposed it to the Python bindings as the is_attr method of Cursor<br>* Fixing TranslationUnit.get_includes to only go through the argument buffer when it contains something. This fixed a crash on Windows<br>



* clang_getFileName returns CXString, not char*. Made appropriate fixes in cindex.py - now the relevant tests pass and we can see the full locations correctly again (previously there was garbage in place of the file name)<br>



* Exposed clang_getCursorDisplayName to the python bindings<br></div></div></div></blockquote><br></div></div><div>Very nice.</div><div><br></div><div><div class="im"><blockquote type="cite"><div dir="ltr"><div class="gmail_quote">

<div>P.S. the patch file was created with 'svn diff' in the root of clang, so it should be applied as 'patch -p0' there. I hope this is an accepted way to submit patches - if something different is required, I'll gladly fix.<br>

</div></div></div></blockquote><div><br></div></div>Yes, this is the right way to submit patches, thanks for working on this!</div><div><br></div><div>A few minor comments:</div><div><br></div><div><div>Index: include/clang-c/Index.h</div>

<div>===================================================================</div><div>--- include/clang-c/Index.h<span style="white-space:pre-wrap">     </span>(revision 134366)</div><div>+++ include/clang-c/Index.h<span style="white-space:pre-wrap">     </span>(working copy)</div>

<div>@@ -1474,6 +1474,11 @@</div><div> CINDEX_LINKAGE unsigned clang_isStatement(enum CXCursorKind);</div><div> </div><div> /**</div><div>+ * \brief Determine whether the given cursor kind represents an attribute.</div><div>

+ */</div><div>+CINDEX_LINKAGE unsigned clang_isAttr(enum CXCursorKind);</div><div>+</div><div>+/**</div><div><br></div><div>Please name this "clang_isAttribute" to be more consistent with the naming of similar functions.</div>

<div><br></div><div><div>Index: tools/libclang/libclang.exports</div><div>===================================================================</div><div>--- tools/libclang/libclang.exports<span style="white-space:pre-wrap">    </span>(revision 134366)</div>

<div>+++ tools/libclang/libclang.exports<span style="white-space:pre-wrap">       </span>(working copy)</div><div>@@ -123,6 +123,7 @@</div><div> clang_isReference</div><div> clang_isRestrictQualifiedType</div><div> clang_isStatement</div>

<div>+clang_isAttr</div><div> clang_isTranslationUnit</div><div> clang_isUnexposed</div><div> clang_isVirtualBase</div></div><div><br></div><div>This list is meant to be sorted. Also, please update libclang.darwin.exports as well.</div>

<div><br></div></div></div></blockquote><div><br>Hi Doug, thanks for the review. I'm attaching an updated patch with fixes for all your comments. <br><br>Eli<br><br><br><br><br> </div></div></div>