Esempio n. 1
0
File: parse.go Progetto: h12w/cwrap
func newExported(t gcc.Named) baseCNamer {
	return baseCNamer{
		id:    t.Id(),
		cName: t.CName(),
		file:  t.File(),
	}
}
Esempio n. 2
0
// 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
}