Change Go types to simple unsafe Pointers instead of pointers

wrapped in structs. It could be possible to handle pointers to
pointers now.
This commit is contained in:
gmp
2019-04-30 09:14:25 -04:00
parent 0e89d2c29a
commit 3573aa9144
5 changed files with 30 additions and 50 deletions
+1
View File
@@ -1,4 +1,5 @@
package main
//go:generate nswrap
import (
"fmt"
-2
View File
@@ -1,7 +1,5 @@
InputFiles = [
"/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h",
# "/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h",
# "/System/Library/Frameworks/Foundation.framework/Headers/NSString.h",
]
Classes = [
"NSArray",
+7 -4
View File
@@ -1,21 +1,24 @@
package main
//go:generate nswrap
import (
"fmt"
"gitlab.wow.st/gmp/nswrap/examples/simple/ClassOne"
ns "gitlab.wow.st/gmp/nswrap/examples/simple/ClassOne"
)
func main() {
o := ClassOne.NewClassOne().Init()
o := ns.NewClassOne().Init()
fmt.Println("i1 = ",o.Geti1())
fmt.Println("p1 = ",o.Getp1())
p1 := o.Getp1()
fmt.Println("*p1 = ", *p1)
*p1 = 17
fmt.Println("*p1 = ", *o.Getp1())
ns := o.Nstru1()
ns1 := o.Nstru1()
np := o.Nstru2()
fmt.Println(o.Hi1(ns))
fmt.Println(o.Hi1(ns1))
fmt.Println(o.Hi2(np))
o2 := ns.NewClassTwo().Init()
fmt.Println(o2.Hi1(ns1))
}