2019-04-26 22:44:30 -04:00
|
|
|
package main
|
2019-04-30 09:14:25 -04:00
|
|
|
//go:generate nswrap
|
2019-04-26 22:44:30 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2019-04-30 09:14:25 -04:00
|
|
|
ns "gitlab.wow.st/gmp/nswrap/examples/simple/ClassOne"
|
2019-04-26 22:44:30 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2019-05-06 13:21:36 -04:00
|
|
|
o := ns.ClassOneAlloc().Init()
|
2019-04-26 22:44:30 -04:00
|
|
|
fmt.Println("i1 = ",o.Geti1())
|
|
|
|
fmt.Println("p1 = ",o.Getp1())
|
|
|
|
p1 := o.Getp1()
|
|
|
|
fmt.Println("*p1 = ", *p1)
|
|
|
|
*p1 = 17
|
|
|
|
fmt.Println("*p1 = ", *o.Getp1())
|
2019-04-30 09:14:25 -04:00
|
|
|
ns1 := o.Nstru1()
|
2019-04-26 22:44:30 -04:00
|
|
|
np := o.Nstru2()
|
2019-04-30 09:14:25 -04:00
|
|
|
fmt.Println(o.Hi1(ns1))
|
2019-04-26 22:44:30 -04:00
|
|
|
fmt.Println(o.Hi2(np))
|
2019-05-06 13:21:36 -04:00
|
|
|
o2 := ns.ClassTwoAlloc().Init()
|
2019-04-30 09:14:25 -04:00
|
|
|
fmt.Println(o2.Hi1(ns1))
|
2019-04-26 22:44:30 -04:00
|
|
|
}
|
|
|
|
|