Esempio n. 1
0
func ProcessEnumInfo(ei *gi.EnumInfo) {
	// done
	printf("type %s %s\n", ei.Name(), CgoTypeForTag(ei.StorageType(), TypeNone))
	printf("const (\n")
	for i, n := 0, ei.NumValue(); i < n; i++ {
		val := ei.Value(i)
		printf("\t%s%s %s = %d\n", ei.Name(),
			LowerCaseToCamelCase(val.Name()), ei.Name(), val.Value())
	}
	printf(")\n")
}
Esempio n. 2
0
func (this *binding_generator) process_enum_info(ei *gi.EnumInfo) {
	p := printer_to(&this.go_bindings)

	p("type %s %s\n", ei.Name(), cgo_type_for_tag(ei.StorageType(), type_none))
	p("const (\n")
	for i, n := 0, ei.NumValue(); i < n; i++ {
		val := ei.Value(i)
		p("\t%s%s %s = %d\n", ei.Name(),
			lower_case_to_camel_case(val.Name()), ei.Name(), val.Value())
	}
	p(")\n")
}