github.com/goplus/llgo@v0.8.3/cl/_testrt/named/in.go (about)

     1  package main
     2  
     3  import "github.com/goplus/llgo/internal/runtime/c"
     4  
     5  type mSpanList struct {
     6  	first *mspan
     7  	last  *mspan
     8  }
     9  
    10  type minfo struct {
    11  	span *mspan
    12  	info int
    13  }
    14  
    15  type mspan struct {
    16  	next  *mspan
    17  	prev  *mspan
    18  	list  *mSpanList
    19  	info  minfo
    20  	value int
    21  	check func(int) int
    22  }
    23  
    24  func main() {
    25  	m := &mspan{}
    26  	m.value = 100
    27  	m.next = &mspan{}
    28  	m.next.value = 200
    29  	m.list = &mSpanList{}
    30  	m.list.last = &mspan{}
    31  	m.list.last.value = 300
    32  	m.info.info = 10
    33  	m.info.span = m
    34  	m.check = func(n int) int {
    35  		return m.value * n
    36  	}
    37  	c.Printf(c.Str("%d %d %d %d %d %d\n"), m.next.value, m.list.last.value, m.info.info,
    38  		m.info.span.value, m.check(-2), m.info.span.check(-3))
    39  }