Example #1
0
/*
	Retrieve a file handle within the given translation unit.

	Parameter tu the translation unit

	Parameter file_name the name of the file.

	Returns the file handle for the named file in the translation unit \p tu,
	or a NULL file handle if the file was not a part of this translation unit.
*/
func (tu TranslationUnit) File(fileName string) File {
	c_fileName := C.CString(fileName)
	defer C.free(unsafe.Pointer(c_fileName))

	return File{C.clang_getFile(tu.c, c_fileName)}
}
Example #2
0
func (tu TranslationUnit) File(file_name string) File {
	cfname := C.CString(file_name)
	defer C.free(unsafe.Pointer(cfname))
	f := C.clang_getFile(tu.c, cfname)
	return File{f}
}