func CompileFile(name string, start StartToken) (*Code, error) { fn := C.CString(name) defer C.free(unsafe.Pointer(fn)) file, err := C.openFile(fn) if file == nil { return nil, err } defer C.fclose(file) ret := C.compileFile(file, fn, C.int(start)) if ret == nil { return nil, exception() } return newCode(ret), nil }
func (w *window) openFile(f func(filename string)) { C.openFile(w.id, unsafe.Pointer(&f)) }