Beispiel #1
0
func (c *Config) IterKeys(sec string) chan string {
	channel := make(chan string)
	go func() {
		var iter *C.ALLEGRO_CONFIG_ENTRY
		ss := C.CString(sec)
		defer C.free(unsafe.Pointer(ss))

		var key_ptr *C.char

		key_ptr = C.al_get_first_config_entry((*C.ALLEGRO_CONFIG)(c), ss, &iter)

		for key_ptr != nil {
			key := C.GoString(key_ptr)
			channel <- key

			key_ptr = C.al_get_next_config_entry(&iter)

		}
		close(channel)
	}()
	return channel
}
Beispiel #2
0
func GetNextEntry(iterator **ConfigEntry) string {
	return C.GoString(C.al_get_next_config_entry((**C.ALLEGRO_CONFIG_ENTRY)(unsafe.Pointer(iterator))))
}