cgoutil

package module
v0.0.0-...-a663f08 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: MIT Imports: 2 Imported by: 0

README

cgoutil

Cgoutil implements some Cgo utility functions

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CStringArray

type CStringArray struct {
	Length  int
	Pointer unsafe.Pointer
}

CStringArray represents an array of pointers to NULL terminated C strings, the array itself is terminated with a NULL

func NewCStringArray

func NewCStringArray() *CStringArray

NewCStringArray returns an instance of CStringArray

func NewCStringArrayFromPointer

func NewCStringArrayFromPointer(p unsafe.Pointer) *CStringArray

func NewCStringArrayFromSlice

func NewCStringArrayFromSlice(ss []string) *CStringArray

NewCStringArrayFromSlice makes an instance of CStringArray then copy the input slice to it.

func (*CStringArray) Copy

func (arr *CStringArray) Copy(ss []string)

Copy converts Go slice of strings to C underlying struct of CStringArray

func (*CStringArray) Free

func (arr *CStringArray) Free()

Free frees C underlying struct of CStringArray MUST call this method after using CStringArray Exception: If you use NewCStringArrayFromPointer() to create CStringArray object and you use other way to free C underlying structure pointed by the pointer, then don't need to call Free()

func (*CStringArray) ToSlice

func (arr *CStringArray) ToSlice() []string

ToSlice converts CStringArray to Go slice of strings

Jump to

Keyboard shortcuts

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