Query function declarations in the files.

def query_names(self, name, like, kind):
        """
        Query function declarations in the files.
        """
        kind = self._make_kind_id(kind)
        sql = 'select id, name from files ' \
              'where leaf_name {} ?'.format('like' if like else '=')
        args = (name,)
        if like:
            sql += ' escape ?'
            args = (name, '\\')
        logging.debug('%s %s', sql, args)
        self.cursor.execute(sql, args)
        ids = self.cursor.fetchall()
        files = []
        for file_id, header in ids:
            sql = 'select name from code_items ' \
                  'where file_id = ?'
            args = (file_id,)
            if kind:
                sql += 'and kind = ?'
                args = (file_id, kind)
            logging.debug('%s %s', sql, args)
            self.cursor.execute(sql, args)
            files.append((header, self.cursor.fetchall()))
        return files