示例#1
0
func (c *Config) IterSections() chan string {
	channel := make(chan string)
	go func() {
		var iter *C.ALLEGRO_CONFIG_SECTION

		var name_ptr *C.char

		name_ptr = C.al_get_first_config_section((*C.ALLEGRO_CONFIG)(c), &iter)

		for name_ptr != nil {
			name := C.GoString(name_ptr)
			channel <- name

			name_ptr = C.al_get_next_config_section(&iter)

		}
		close(channel)
	}()
	return channel
}
示例#2
0
func (c *Config) GetFirstSection() (string, **ConfigSection) {
	cs := new((*C.ALLEGRO_CONFIG_SECTION))
	s := C.al_get_first_config_section((*C.ALLEGRO_CONFIG)(unsafe.Pointer(c)), cs)
	return C.GoString(s), (**ConfigSection)(unsafe.Pointer(cs))
}