cgo: github.com/chai2010/cgo Index | Files

package cgo

import "github.com/chai2010/cgo"

Index

Package Files

cgo.go char.go error.go file.go goobj.go string.go string_list.go types.go void_pointer.go

Constants

const (
    EOF = C.EOF

    SEEK_CUR = C.SEEK_CUR
    SEEK_SET = C.SEEK_SET
    SEEK_END = C.SEEK_END
)

Variables

var (
    Stdin  = (*File)(C.cgo_get_stdin())
    Stdout = (*File)(C.cgo_get_stdout())
    Stderr = (*File)(C.cgo_get_stderr())
)

func CBytes Uses

func CBytes(s []byte) unsafe.Pointer

Go []byte slice to C array The C array is allocated in the C heap using malloc. It is the caller's responsibility to arrange for it to be freed, such as by calling C.free (be sure to include stdlib.h if C.free is needed).

func GoBytes Uses

func GoBytes(p unsafe.Pointer, n int) []byte

C data with explicit length to Go []byte

func GoString Uses

func GoString(s *Char) string

C string to Go string

func GoStringN Uses

func GoStringN(s *Char, n int) string

C data with explicit length to Go string

type Bool Uses

type Bool C.char

func NewBool Uses

func NewBool(firstValue bool, moreValues ...bool) *Bool

func NewBoolN Uses

func NewBoolN(n int) *Bool

func (*Bool) First Uses

func (s *Bool) First() bool

func (*Bool) Free Uses

func (s *Bool) Free()

func (*Bool) Slice Uses

func (s *Bool) Slice(n int) []byte

type Char Uses

type Char C.char

func CString Uses

func CString(s string) *Char

Go string to C string The C string is allocated in the C heap using malloc. It is the caller's responsibility to arrange for it to be freed, such as by calling C.free (be sure to include stdlib.h if C.free is needed).

func NewChar Uses

func NewChar(firstValue int, moreValues ...int) *Char

func NewCharFormat Uses

func NewCharFormat(format string, args ...interface{}) *Char

func NewCharN Uses

func NewCharN(n int) *Char

func NewCharString Uses

func NewCharString(s string) *Char

Go string to C string The C string is allocated in the C heap using malloc. It is the caller's responsibility to arrange for it to be freed, such as by calling C.free (be sure to include stdlib.h if C.free is needed).

func (*Char) First Uses

func (s *Char) First() byte

func (*Char) Free Uses

func (s *Char) Free()

func (*Char) GoBytes Uses

func (s *Char) GoBytes(n int) []byte

func (*Char) GoString Uses

func (s *Char) GoString() string

C string to Go string

func (*Char) GoStringN Uses

func (s *Char) GoStringN(n int) string

C data with explicit length to Go string

func (*Char) IsEmpty Uses

func (s *Char) IsEmpty() bool

func (*Char) Slice Uses

func (s *Char) Slice(n int) []byte

func (*Char) Strcat Uses

func (dst *Char) Strcat(src *Char) *Char

func (*Char) Strchr Uses

func (s *Char) Strchr(ch int) *Char

func (*Char) Strcpy Uses

func (dst *Char) Strcpy(src *Char) *Char

func (*Char) Strcspn Uses

func (s *Char) Strcspn(s2 *Char) int

func (*Char) Strdup Uses

func (s *Char) Strdup() *Char

func (*Char) Strlen Uses

func (s *Char) Strlen() int

func (*Char) Strncat Uses

func (dst *Char) Strncat(src *Char, num int) *Char

func (*Char) Strncpy Uses

func (dst *Char) Strncpy(src *Char, num int) *Char

func (*Char) Strpbrk Uses

func (s *Char) Strpbrk(s2 *Char) *Char

func (*Char) Strrchr Uses

func (s *Char) Strrchr(ch int) *Char

func (*Char) Strspn Uses

func (s *Char) Strspn(s2 *Char) int

func (*Char) Strstr Uses

func (s *Char) Strstr(s2 *Char) *Char

func (*Char) Strtok Uses

func (s *Char) Strtok(delimiters *Char) *Char

type Double Uses

type Double C.double

func NewDouble Uses

func NewDouble(firstValue float64, moreValues ...float64) *Double

func NewDoubleN Uses

func NewDoubleN(n int) *Double

func (*Double) First Uses

func (p *Double) First() float64

func (*Double) Free Uses

func (p *Double) Free()

func (*Double) Slice Uses

func (p *Double) Slice(n int) []float64

type Error Uses

type Error C.chai2010_cgo_Error_T

func NewError Uses

func NewError(code int, desc *Char) *Error

func NewErrorFrom Uses

func NewErrorFrom(code int, desc string) *Error

func (*Error) Delete Uses

func (p *Error) Delete()

func (*Error) GetCode Uses

func (p *Error) GetCode() int

func (*Error) GetText Uses

func (p *Error) GetText() *Char

func (*Error) SetError Uses

func (p *Error) SetError(code int, desc *Char)

func (*Error) SetErrorFrom Uses

func (p *Error) SetErrorFrom(code int, desc string)

type File Uses

type File C.FILE

func OpenFile Uses

func OpenFile(filename, mode *Char) *File

func TempFile Uses

func TempFile() *File

func (*File) ClearErr Uses

func (f *File) ClearErr()

func (*File) Close Uses

func (f *File) Close() error

func (*File) Eof Uses

func (f *File) Eof() int

func (*File) Error Uses

func (f *File) Error() int

func (*File) Flush Uses

func (f *File) Flush()

func (*File) Getc Uses

func (f *File) Getc() int

func (*File) Gets Uses

func (f *File) Gets(buf []byte) *Char

func (*File) Putc Uses

func (f *File) Putc(ch int) int

func (*File) Puts Uses

func (f *File) Puts(s *Char)

func (*File) Read Uses

func (f *File) Read(buf []byte) (int, error)

func (*File) ReadByte Uses

func (f *File) ReadByte() (c byte, err error)

func (*File) Rewind Uses

func (f *File) Rewind()

func (*File) Seek Uses

func (f *File) Seek(off int64, origin int) (int64, error)

func (*File) Tell Uses

func (f *File) Tell() int64

func (*File) Ungetc Uses

func (f *File) Ungetc(ch int) int

func (*File) Write Uses

func (f *File) Write(buf []byte) (int, error)

func (*File) WriteByte Uses

func (f *File) WriteByte(c byte) error

type Float Uses

type Float C.float

func NewFloat Uses

func NewFloat(firstValue float32, moreValues ...float32) *Float

func NewFloatN Uses

func NewFloatN(n int) *Float

func (*Float) First Uses

func (p *Float) First() float32

func (*Float) Free Uses

func (p *Float) Free()

func (*Float) Slice Uses

func (p *Float) Slice(n int) []float32

type Int Uses

type Int C.int

func NewInt Uses

func NewInt(firstValue int, moreValues ...int) *Int

func NewIntN Uses

func NewIntN(n int) *Int

func (*Int) First Uses

func (p *Int) First() int

func (*Int) Free Uses

func (p *Int) Free()

func (*Int) Slice Uses

func (p *Int) Slice(n int) []Int

type Int16 Uses

type Int16 C.int16_t

func NewInt16 Uses

func NewInt16(firstValue int16, moreValues ...int16) *Int16

func NewInt16N Uses

func NewInt16N(n int) *Int16

func (*Int16) First Uses

func (p *Int16) First() int16

func (*Int16) Free Uses

func (p *Int16) Free()

func (*Int16) Slice Uses

func (p *Int16) Slice(n int) []int16

type Int32 Uses

type Int32 C.int32_t

func NewInt32 Uses

func NewInt32(firstValue int32, moreValues ...int32) *Int32

func NewInt32N Uses

func NewInt32N(n int) *Int32

func (*Int32) First Uses

func (p *Int32) First() int32

func (*Int32) Free Uses

func (p *Int32) Free()

func (*Int32) Slice Uses

func (p *Int32) Slice(n int) []int32

type Int64 Uses

type Int64 C.int64_t

func NewInt64 Uses

func NewInt64(firstValue int64, moreValues ...int64) *Int64

func NewInt64N Uses

func NewInt64N(n int) *Int64

func (*Int64) First Uses

func (p *Int64) First() int64

func (*Int64) Free Uses

func (p *Int64) Free()

func (*Int64) Slice Uses

func (p *Int64) Slice(n int) []int64

type Int8 Uses

type Int8 C.int8_t

func NewInt8 Uses

func NewInt8(firstValue int8, moreValues ...int8) *Int8

func NewInt8N Uses

func NewInt8N(n int) *Int8

func (*Int8) First Uses

func (p *Int8) First() int8

func (*Int8) Free Uses

func (p *Int8) Free()

func (*Int8) Slice Uses

func (p *Int8) Slice(n int) []int8

type IntPtr Uses

type IntPtr C.intptr_t

func NewIntPtr Uses

func NewIntPtr(firstValue uintptr, moreValues ...uintptr) *IntPtr

func NewIntPtrN Uses

func NewIntPtrN(n int) *IntPtr

func (*IntPtr) First Uses

func (p *IntPtr) First() uintptr

func (*IntPtr) Free Uses

func (p *IntPtr) Free()

func (*IntPtr) Slice Uses

func (p *IntPtr) Slice(n int) []IntPtr

type ObjectId Uses

type ObjectId int32

func NewObjectId Uses

func NewObjectId(obj interface{}) ObjectId

func (*ObjectId) Free Uses

func (id *ObjectId) Free() interface{}

func (ObjectId) Get Uses

func (id ObjectId) Get() interface{}

func (ObjectId) IsNil Uses

func (id ObjectId) IsNil() bool

type SizeT Uses

type SizeT C.size_t

func NewSizeT Uses

func NewSizeT(firstValue int, moreValues ...int) *SizeT

func NewSizeTN Uses

func NewSizeTN(n int) *SizeT

func (*SizeT) First Uses

func (p *SizeT) First() int

func (*SizeT) Free Uses

func (p *SizeT) Free()

func (*SizeT) Slice Uses

func (p *SizeT) Slice(n int) []SizeT

type String Uses

type String C.chai2010_cgo_String_T

func NewString Uses

func NewString(s string) *String

func NewStringFormat Uses

func NewStringFormat(format string, args ...interface{}) *String

func NewStringFromStr Uses

func NewStringFromStr(s *Char) *String

func NewStringFromStrN Uses

func NewStringFromStrN(s *Char, n int) *String

func (*String) AssignByGoBytes Uses

func (s *String) AssignByGoBytes(str []byte)

func (*String) AssignByGoString Uses

func (s *String) AssignByGoString(str string)

func (*String) AssignStr Uses

func (s *String) AssignStr(str *Char)

func (*String) AssignStrN Uses

func (s *String) AssignStrN(str *Char, n int)

func (*String) CStr Uses

func (s *String) CStr() *Char

func (*String) Clear Uses

func (s *String) Clear()

func (*String) Data Uses

func (s *String) Data() *Char

func (*String) Delete Uses

func (s *String) Delete()

func (*String) GoSlice Uses

func (s *String) GoSlice() []byte

func (*String) GoString Uses

func (s *String) GoString() string

func (*String) Resize Uses

func (s *String) Resize(newSize int)

func (*String) Size Uses

func (s *String) Size() int

type StringList Uses

type StringList C.chai2010_cgo_StringList_T

func NewStringList Uses

func NewStringList(args ...string) *StringList

func (*StringList) AppendByGoSlice Uses

func (p *StringList) AppendByGoSlice(s []byte)

func (*StringList) AppendByGoString Uses

func (p *StringList) AppendByGoString(s string)

func (*StringList) AppendStr Uses

func (p *StringList) AppendStr(str *Char)

func (*StringList) AppendStrN Uses

func (p *StringList) AppendStrN(str *Char, n int)

func (*StringList) AssignByGoSlice Uses

func (p *StringList) AssignByGoSlice(i int, s []byte)

func (*StringList) AssignByGoString Uses

func (p *StringList) AssignByGoString(i int, s string)

func (*StringList) AssignStr Uses

func (p *StringList) AssignStr(i int, s *Char)

func (*StringList) AssignStrN Uses

func (p *StringList) AssignStrN(i int, s *Char, n int)

func (*StringList) Clear Uses

func (p *StringList) Clear()

func (*StringList) Delete Uses

func (p *StringList) Delete()

func (*StringList) Resize Uses

func (p *StringList) Resize(newSize int)

func (*StringList) Size Uses

func (p *StringList) Size() int

func (*StringList) StrCStr Uses

func (p *StringList) StrCStr(i int) *Char

func (*StringList) StrClear Uses

func (p *StringList) StrClear(i int)

func (*StringList) StrData Uses

func (p *StringList) StrData(i int) *Char

func (*StringList) StrGoData Uses

func (p *StringList) StrGoData(i int) []byte

func (*StringList) StrGoString Uses

func (p *StringList) StrGoString(i int) string

func (*StringList) StrResize Uses

func (p *StringList) StrResize(i, newSize int)

func (*StringList) StrSize Uses

func (p *StringList) StrSize(i int) int

type UInt Uses

type UInt C.uint

func NewUInt Uses

func NewUInt(firstValue uint, moreValues ...uint) *UInt

func NewUIntN Uses

func NewUIntN(n int) *UInt

func (*UInt) First Uses

func (p *UInt) First() uint

func (*UInt) Free Uses

func (p *UInt) Free()

func (*UInt) Slice Uses

func (p *UInt) Slice(n int) []UInt

type UInt16 Uses

type UInt16 C.uint16_t

func NewUInt16 Uses

func NewUInt16(firstValue uint16, moreValues ...uint16) *UInt16

func NewUInt16N Uses

func NewUInt16N(n int) *UInt16

func (*UInt16) First Uses

func (p *UInt16) First() uint16

func (*UInt16) Free Uses

func (p *UInt16) Free()

func (*UInt16) Slice Uses

func (p *UInt16) Slice(n int) []uint16

type UInt32 Uses

type UInt32 C.uint32_t

func NewUInt32 Uses

func NewUInt32(firstValue uint32, moreValues ...uint32) *UInt32

func NewUInt32N Uses

func NewUInt32N(n int) *UInt32

func (*UInt32) First Uses

func (p *UInt32) First() uint32

func (*UInt32) Free Uses

func (p *UInt32) Free()

func (*UInt32) Slice Uses

func (p *UInt32) Slice(n int) []uint32

type UInt64 Uses

type UInt64 C.uint64_t

func NewUInt64 Uses

func NewUInt64(firstValue uint64, moreValues ...uint64) *UInt64

func NewUInt64N Uses

func NewUInt64N(n int) *UInt64

func (*UInt64) First Uses

func (p *UInt64) First() uint64

func (*UInt64) Free Uses

func (p *UInt64) Free()

func (*UInt64) Slice Uses

func (p *UInt64) Slice(n int) []uint64

type UInt8 Uses

type UInt8 C.uint8_t

func NewUInt8 Uses

func NewUInt8(firstValue uint8, moreValues ...uint8) *UInt8

func NewUInt8N Uses

func NewUInt8N(n int) *UInt8

func (*UInt8) First Uses

func (p *UInt8) First() uint8

func (*UInt8) Free Uses

func (p *UInt8) Free()

func (*UInt8) Slice Uses

func (p *UInt8) Slice(n int) []uint8

type UIntPtr Uses

type UIntPtr C.uintptr_t

func NewUIntPtr Uses

func NewUIntPtr(firstValue uintptr, moreValues ...uintptr) *UIntPtr

func NewUIntPtrN Uses

func NewUIntPtrN(n int) *UIntPtr

func (*UIntPtr) First Uses

func (p *UIntPtr) First() uintptr

func (*UIntPtr) Free Uses

func (p *UIntPtr) Free()

func (*UIntPtr) Slice Uses

func (p *UIntPtr) Slice(n int) []UIntPtr

type VoidPointer Uses

type VoidPointer uintptr

func Calloc Uses

func Calloc(num, size int) VoidPointer

func Malloc Uses

func Malloc(n int) VoidPointer

func NewBytes Uses

func NewBytes(s []byte) VoidPointer

Go []byte slice to C array The C array is allocated in the C heap using malloc. It is the caller's responsibility to arrange for it to be freed, such as by calling C.free (be sure to include stdlib.h if C.free is needed).

func (VoidPointer) ByteSlice Uses

func (p VoidPointer) ByteSlice(n int) []byte

func (VoidPointer) Float32Slice Uses

func (p VoidPointer) Float32Slice(n int) []float32

func (VoidPointer) Float64Slice Uses

func (p VoidPointer) Float64Slice(n int) []float64

func (VoidPointer) Free Uses

func (p VoidPointer) Free()

func (VoidPointer) GoBytes Uses

func (p VoidPointer) GoBytes(n int) []byte

C data with explicit length to Go []byte

func (VoidPointer) GoString Uses

func (p VoidPointer) GoString() string

C string to Go string

func (VoidPointer) GoStringN Uses

func (p VoidPointer) GoStringN(n int) string

C data with explicit length to Go string

func (VoidPointer) Int16Slice Uses

func (p VoidPointer) Int16Slice(n int) []int16

func (VoidPointer) Int32Slice Uses

func (p VoidPointer) Int32Slice(n int) []int32

func (VoidPointer) Int64Slice Uses

func (p VoidPointer) Int64Slice(n int) []int64

func (VoidPointer) Int8Slice Uses

func (p VoidPointer) Int8Slice(n int) []int8

func (VoidPointer) Memchr Uses

func (p VoidPointer) Memchr(value, num int) VoidPointer

func (VoidPointer) Memcpy Uses

func (p VoidPointer) Memcpy(src VoidPointer, num int) VoidPointer

func (VoidPointer) Memmove Uses

func (p VoidPointer) Memmove(src VoidPointer, num int) VoidPointer

func (VoidPointer) Memset Uses

func (p VoidPointer) Memset(value, num int) VoidPointer

func (*VoidPointer) Realloc Uses

func (p *VoidPointer) Realloc(newSize int) VoidPointer

func (VoidPointer) UInt16Slice Uses

func (p VoidPointer) UInt16Slice(n int) []uint16

func (VoidPointer) UInt32Slice Uses

func (p VoidPointer) UInt32Slice(n int) []uint32

func (VoidPointer) UInt64Slice Uses

func (p VoidPointer) UInt64Slice(n int) []uint64

func (VoidPointer) UInt8Slice Uses

func (p VoidPointer) UInt8Slice(n int) []uint8

Package cgo imports 7 packages (graph). Updated 2016-09-08. Refresh now. Tools for package owners.