Пример #1
0
// Test function for elevator
func Test_Run() {
	err := C.run()
	if err != 0 {
		fmt.Println("Test program terminated abnormally")
	}
	fmt.Println("Test program terminated normally")
}
Пример #2
0
// Test function for elevator
func Test_Run() {
	fmt.Println("Attempting to run elevator")
	err := C.run()
	if err != 0 {
		fmt.Println("Test program terminated abnormally")
	}
	fmt.Println("Test program terminated normally")
}
Пример #3
0
Файл: main.go Проект: reusee/p
func main() {
	var cArgs []*C.char
	for _, arg := range os.Args {
		cArgs = append(cArgs, C.CString(arg))
	}
	runtime.LockOSThread()
	_, f, _, _ := runtime.Caller(0)
	C.run(C.int(len(os.Args)), &cArgs[0], C.CString(filepath.Join(filepath.Dir(f), "main.qml")))
}
Пример #4
0
func main() {
	if len(os.Args) != 2 {
		fmt.Printf("%v\n", printHelp())
		os.Exit(1)
	}

	path, err := filepath.Abs(os.Args[1])
	if err != nil {
		fmt.Printf("%v\n", printHelp())
		os.Exit(1)
	}

	url := C.CString(fmt.Sprintf("file://%s", path))
	defer C.free(unsafe.Pointer(url))
	C.run(url)

	os.Exit(0)
}
Пример #5
0
func main() {
	C.run()
}
Пример #6
0
func main() {
	C.run()

	//fmt.Printf("hi")

}
Пример #7
0
func main() {
	if v := C.run(); v != 2 {
		panic(v)
	}
}