Exemplo n.º 1
0
func (c *Config) GetValue(section, key string) string {
	s := C.CString(section)
	defer C.free(unsafe.Pointer(s))
	k := C.CString(key)
	defer C.free(unsafe.Pointer(k))
	return C.GoString(C.al_get_config_value((*C.ALLEGRO_CONFIG)(unsafe.Pointer(c)), s, k))
}
Exemplo n.º 2
0
func (c *Config) Get(section string, key string) (string, bool) {
	ss := C.CString(section)
	defer C.free(unsafe.Pointer(ss))
	ks := C.CString(key)
	defer C.free(unsafe.Pointer(ks))

	var cstr *C.char

	cstr = C.al_get_config_value((*C.ALLEGRO_CONFIG)(c), ss, ks)

	if cstr == nil {
		return "", false
	}
	return C.GoString(cstr), true
}