コード例 #1
0
ファイル: clang.go プロジェクト: quarnster/go-clang
/**
 * \brief Retrieve a diagnostic associated with the given translation unit.
 *
 * \param Unit the translation unit to query.
 * \param Index the zero-based diagnostic number to retrieve.
 *
 * \returns the requested diagnostic. This diagnostic must be freed
 * via a call to \c clang_disposeDiagnostic().
 */
func (tu TranslationUnit) Diagnostics() (ret Diagnostics) {
	ret = make(Diagnostics, C.clang_getNumDiagnostics(tu.c))
	for i := range ret {
		ret[i].c = C.clang_getDiagnostic(tu.c, C.uint(i))
	}
	return
}
コード例 #2
0
ファイル: translationunit_gen.go プロジェクト: go-clang/v3.4
/*
	Retrieve a diagnostic associated with the given translation unit.

	Parameter Unit the translation unit to query.
	Parameter Index the zero-based diagnostic number to retrieve.

	Returns the requested diagnostic. This diagnostic must be freed
	via a call to clang_disposeDiagnostic().
*/
func (tu TranslationUnit) Diagnostic(index uint32) Diagnostic {
	return Diagnostic{C.clang_getDiagnostic(tu.c, C.uint(index))}
}