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

     1  package main
     2  
     3  import (
     4  	"github.com/goplus/llgo/internal/abi"
     5  	"github.com/goplus/llgo/internal/runtime/c"
     6  )
     7  
     8  func Basic(kind abi.Kind) *abi.Type {
     9  	return basicTypes[kind]
    10  }
    11  
    12  var (
    13  	basicTypes = [...]*abi.Type{
    14  		abi.String: basicType(abi.String),
    15  	}
    16  	sizeBasicTypes = [...]uintptr{
    17  		abi.String: 16,
    18  	}
    19  )
    20  
    21  func basicType(kind abi.Kind) *abi.Type {
    22  	return &abi.Type{
    23  		Size_: sizeBasicTypes[kind],
    24  		Hash:  uint32(kind),
    25  		Kind_: uint8(kind),
    26  	}
    27  }
    28  
    29  func main() {
    30  	t := Basic(abi.String)
    31  	c.Printf(c.Str("Kind: %d, Size: %d\n"), int(t.Kind_), t.Size_)
    32  }