cgohelpers

package module
v0.0.0-...-2c3e074 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2017 License: BSD-3-Clause Imports: 4 Imported by: 1

README

cgohelpers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToChar

func BoolToChar(v bool) C.char

func BoolToInt

func BoolToInt(v bool) C.int

func CFreeBuf

func CFreeBuf(data []byte)

func CFreeBufMulti

func CFreeBufMulti(datas [][]byte)

func CFreeUintptrMulti

func CFreeUintptrMulti(ptrs []uintptr)

func CFreeUnsafe

func CFreeUnsafe(ptr unsafe.Pointer)

func CFreeUnsafeMulti

func CFreeUnsafeMulti(ptrs []unsafe.Pointer)

func CharToBool

func CharToBool(c C.char) bool

if c == 0 returns false for all other values true

func ErrnoGet

func ErrnoGet(err error) error

func IntToBool

func IntToBool(c C.int) bool

if c == 0 returns false for all other values true

func SetBytesSliceHeader

func SetBytesSliceHeader(pData *[]byte, ptr uintptr, len, cap int)

func SetBytesSliceHeaderCapAndLen

func SetBytesSliceHeaderCapAndLen(pData *[]byte, len, cap int)

func SliceHeaderSetCapAndLen

func SliceHeaderSetCapAndLen(sh *reflect.SliceHeader, len, cap int)

Types

type Errno

type Errno uintptr

func (Errno) Error

func (errno Errno) Error() string

type ExternalMultiData

type ExternalMultiData struct {
	MultiData
	// If more are expected to come
	// -> if the corresponding C function is to be invoked again
	HasMore bool
}

it is used to load data in a predefined (in go allocated) ptrs slice

func ExternalMultiDataCreate

func ExternalMultiDataCreate(cap int) (self ExternalMultiData)

func (*ExternalMultiData) Free

func (self *ExternalMultiData) Free()

type MultiData

type MultiData struct {
	// How many ptrs are set
	Cnt   uint64
	Ptrs  []unsafe.Pointer
	Sizes []uint64
}

it is used to load data with a vector which is represented by ptrs

func (*MultiData) Free

func (self *MultiData) Free()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL