title: In libclang how to exclude functions from stdio.h
body: <p>When using libclang, how to exclude function from stdio.h ?</p>
  
  <p>When I use the below source to collect only function definitions, then I end up getting all the functions from stdio.h as well. </p>
  
  <p>I read we can pass '-x c-header' kind of arguments while creating index. But does this way of giving arguments applicable in libclang. </p>
  
  <pre><code>tu = index.parse(self.filename, "-x c-header")
  </code></pre>
  
  <p>After including 'c-header' argument, it wants me to fill in 'unsaved_files' array as well, as per the definition of 'parse' function in 'cindex.py'.</p>
  
  <pre><code>def parse(self, path, args = [], unsaved_files = [], options = 0):
  </code></pre>
  
  <p>I don't know what is the right way to do this.</p>
  
  <pre><code>def funcdefn_visitor(self, node, parent, userdata):
      if node.kind == clang.cindex.CursorKind.FUNCTION_DECL: #gives function definitions
          self.func_defn.append(clang.cindex.Cursor_displayname(node))
          self.func_defn_line_no.append(node.location.line)
          self.func_defn_col_no.append(node.location.column)
      print 'Found %s [line=%s, col=%s]' % (
          clang.cindex.Cursor_displayname(node),
          node.location.line,
          node.location.column)
      return 2 # means continue visiting recursively
  
  index = clang.cindex.Index.create()
  
  tu = index.parse(self.filename)
  #-- link cursor visitor to call back to give function definitions
  clang.cindex.Cursor_visit(
      tu.cursor,
      clang.cindex.Cursor_visit_callback(self.funcdefn_visitor),
      None)
  </code></pre>