github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/cgo/testdata/symbols.out.go (about) 1 package main 2 3 import "unsafe" 4 5 var _ unsafe.Pointer 6 7 //go:linkname C.CString runtime.cgo_CString 8 func C.CString(string) *C.char 9 10 //go:linkname C.GoString runtime.cgo_GoString 11 func C.GoString(*C.char) string 12 13 //go:linkname C.__GoStringN runtime.cgo_GoStringN 14 func C.__GoStringN(*C.char, uintptr) string 15 16 func C.GoStringN(cstr *C.char, length C.int) string { 17 return C.__GoStringN(cstr, uintptr(length)) 18 } 19 20 //go:linkname C.__GoBytes runtime.cgo_GoBytes 21 func C.__GoBytes(unsafe.Pointer, uintptr) []byte 22 23 func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte { 24 return C.__GoBytes(ptr, uintptr(length)) 25 } 26 27 type ( 28 C.char uint8 29 C.schar int8 30 C.uchar uint8 31 C.short int16 32 C.ushort uint16 33 C.int int32 34 C.uint uint32 35 C.long int32 36 C.ulong uint32 37 C.longlong int64 38 C.ulonglong uint64 39 ) 40 41 //export foo 42 func C.foo(a C.int, b C.int) C.int 43 44 var C.foo$funcaddr unsafe.Pointer 45 46 //export variadic0 47 //go:variadic 48 func C.variadic0() 49 50 var C.variadic0$funcaddr unsafe.Pointer 51 52 //export variadic2 53 //go:variadic 54 func C.variadic2(x C.int, y C.int) 55 56 var C.variadic2$funcaddr unsafe.Pointer 57 58 //export _Cgo_static_173c95a79b6df1980521_staticfunc 59 func C.staticfunc!symbols.go(x C.int) 60 61 var C.staticfunc!symbols.go$funcaddr unsafe.Pointer 62 63 //go:extern someValue 64 var C.someValue C.int