Example #1
0
File: audio.go Project: beoran/algo
// Opens an Allegro File
func openFile(filename, mode string) *C.ALLEGRO_FILE {
	cfilename := cstr(filename)
	defer cstrFree(cfilename)
	cmode := cstr(mode)
	defer cstrFree(cmode)
	return C.al_fopen(cfilename, cmode)
}
Example #2
0
func Fopen(path, mode string) *File {
	p := C.CString(path)
	defer C.free(unsafe.Pointer(p))
	m := C.CString(mode)
	defer C.free(unsafe.Pointer(m))
	return (*File)(unsafe.Pointer(C.al_fopen(p, m)))
}