예제 #1
0
파일: parse.go 프로젝트: h12w/cwrap
func newExported(t gcc.Named) baseCNamer {
	return baseCNamer{
		id:    t.Id(),
		cName: t.CName(),
		file:  t.File(),
	}
}
예제 #2
0
파일: package.go 프로젝트: sbinet/cwrap
// upper name that is unique within the package
func (pac *Package) localName(o gcc.Named) string {
	n := pac.upperName(o)
	if sid, exists := pac.localNames[n]; !exists || o.Id() == sid {
		pac.localNames[n] = o.Id()
		return n
	}
	for {
		n += "_"
		if _, exists := pac.localNames[n]; !exists {
			break
		}
	}
	pac.localNames[n] = o.Id()
	return n
}