cgogo

package
v0.0.0-...-e05d22d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 4 Imported by: 0

README

cgogo is a package to make interoperating with Cgo easier.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopySlice

func CopySlice[TDst any, TSrc any](dst []TDst, src []TSrc)

Copy a block of memory from Go to C. To copy a Go string to C, cast the string to []byte.

func Error

func Error(cerr *C.char) error

Consume a C heap allocated char* and return it as a Go error. Before returning, free the C char*. If the input is NULL, then return nil.

func ReadSlice

func ReadSlice[TDst any](r io.Reader, dst []TDst) (int, error)

func ReadSliceAt

func ReadSliceAt[TDst any](r io.ReaderAt, dst []TDst, offset int64) (int, error)

func ReadStruct

func ReadStruct[TDst any](r io.Reader, dst *TDst) (int, error)

func ReadStructAt

func ReadStructAt[TDst any](r io.ReaderAt, dst *TDst, offset int64) (int, error)

func WriteSlice

func WriteSlice[TSrc any](w io.Writer, src []TSrc) (int, error)

func WriteSliceAt

func WriteSliceAt[TSrc any](w io.WriterAt, src []TSrc, offset int64) (int, error)

func WriteStruct

func WriteStruct[TSrc any](w io.Writer, src *TSrc) (int, error)

func WriteStructAt

func WriteStructAt[TSrc any](w io.WriterAt, src *TSrc, offset int64) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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