Documentation
¶
Overview ¶
Package ruby is a wrapper for creating Ruby native extension in Go
ref.
Index ¶
- func Bool2Int(b bool) int
- func Char2String(char *Char) string
- func GetGoStruct(obj VALUE) unsafe.Pointer
- func Int2Bool(i Int) bool
- func NUM2INT(x VALUE) int
- func RbRaise(exc VALUE, format string, a ...interface{})
- func Value2String(str VALUE) string
- type Bool
- type Char
- type Double
- type FdSet
- type Int
- type IntptrT
- type Long
- type Longlong
- type ModeT
- type Short
- type SizeT
- type SsizeT
- type StHashType
- type StructStHashType
- type StructTimespec
- type StructTimeval
- type TimeT
- type Timespec
- type Timeval
- type Uchar
- type Uint32T
- type UintptrT
- type Ulonglong
- type Ushort
- type VaList
- type Void
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Char2String ¶
Char2String convert from *Char to Go string without copy
func RbRaise ¶
func RbRaise(exc VALUE, format string, a ...interface{})
RbRaise calls `rb_raise` in C
Original definition is following
void rb_raise(VALUE exc, const char *fmt, ...)
`format` is supported in Go's format, not Ruby
func Value2String ¶
func Value2String(str VALUE) string
Value2String convert from [VALUE] to Go string
Types ¶
type Char ¶
Char is a type for passing `C.char` in and out of package
func String2Char ¶
String2Char convert from Go string to *Char
2nd return value is a function to free pointer. To prevent memory leaks, this function MUST always be called with `defer` when calling this function.
Example
char, clean := ruby.String2Char("ABCD") defer clean()
func Strings2Chars ¶
Strings2Chars convert from Go strings to **Char
2nd return value is a function to free pointer. To prevent memory leaks, this function MUST always be called with `defer` when calling this function.
Example
chars, clean := ruby.Strings2Chars([]string{"ABCD"}) defer clean()
type StructStHashType ¶
type StructStHashType C.struct_st_hash_type
StructStHashType is a type for passing `C.struct_st_hash_type` in and out of package
type StructTimespec ¶
type StructTimespec C.struct_timespec
StructTimespec is a type for passing `C.struct_timespec` in and out of package
type StructTimeval ¶
type StructTimeval C.struct_timeval
StructTimeval is a type for passing `C.struct_timeval` in and out of package