// 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) }
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))) }