lua51

package
v0.0.0-...-1547954 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgCheck

func ArgCheck(L *State, cond bool, narg int, extramsg string)

func ArgError

func ArgError(L *State, narg int, extramsg string) int

func CallMeta

func CallMeta(L *State, obj int, e string) int

func CheckAny

func CheckAny(L *State, narg int)

func CheckInteger

func CheckInteger(L *State, narg int) int

func CheckNumber

func CheckNumber(L *State, narg int) float64

func CheckOption

func CheckOption(L *State, narg int, def string, lst []string) int

func CheckString

func CheckString(L *State, narg int) string

func CheckType

func CheckType(L *State, narg int, t int)

func CheckUdata

func CheckUdata(L *State, narg int, tname string) unsafe.Pointer

func FmtError

func FmtError(L *State, fmt string, args ...interface{}) int

luaL_error becomes FmtError because of lua_error

func GSub

func GSub(L *State, s string, p string, r string) string

func GetMetaField

func GetMetaField(L *State, obj int, e string) bool

returns false if no such metatable or no such field

func LGetMetaTable

func LGetMetaTable(L *State, tname string)

TODO: rename better... clashes with lua_getmetatable

func LTypename

func LTypename(L *State, index int) string

TODO: rename better

func TypeError

func TypeError(L *State, narg int, tname string) int

TODO: decide if we actually want this renamed

func Unref

func Unref(L *State, t int, ref int)

func Where

func Where(L *State, lvl int)

func XMove

func XMove(from *State, to *State, n int)

Types

type Alloc

type Alloc func(ptr unsafe.Pointer, osize uint, nsize uint) unsafe.Pointer

type GoFunction

type GoFunction func(*State) int

type Reader

type Reader func(L *State, data interface{}) []byte

like lua reader, but the return slice has the size, so does we do not need it to be an out param

type State

type State struct {
	// contains filtered or unexported fields
}

wrapper to keep cgo from complaining about incomplete ptr type

func NewState

func NewState() *State

func NewStateAlloc

func NewStateAlloc(f Alloc) *State

NOTE: lua_newstate becomes NewStateAlloc whereas

luaL_newstate becomes NewState

func (*State) AtPanic

func (L *State) AtPanic(panicf GoFunction) (oldpanicf GoFunction)

func (*State) Call

func (L *State) Call(nargs int, nresults int)

func (*State) CheckStack

func (L *State) CheckStack(extra int) bool

func (*State) Close

func (L *State) Close()

func (*State) Concat

func (L *State) Concat(n int)

func (*State) CreateTable

func (L *State) CreateTable(narr int, nrec int)

func (*State) DoFile

func (L *State) DoFile(filename string) bool

true if no errors, false otherwise

func (*State) DoString

func (L *State) DoString(str string) bool

true if no errors, false otherwise

func (*State) Dump

func (L *State) Dump(writer Writer, data interface{}) int

TODO: data be a slice?

func (*State) Equal

func (L *State) Equal(index1, index2 int) bool

func (*State) Error

func (L *State) Error() int

func (*State) GC

func (L *State) GC(what, data int) int

func (*State) GetField

func (L *State) GetField(index int, k string)

func (*State) GetGlobal

func (L *State) GetGlobal(name string)

func (*State) GetMetaTable

func (L *State) GetMetaTable(index int) bool

func (*State) GetTable

func (L *State) GetTable(index int)

func (*State) GetTop

func (L *State) GetTop() int

func (*State) GetfEnv

func (L *State) GetfEnv(index int)

func (*State) GoPCall

func (L *State) GoPCall(fun GoFunction, ud interface{}) int

CPcall replacement

func (*State) Insert

func (L *State) Insert(index int)

func (*State) IsBoolean

func (L *State) IsBoolean(index int) bool

func (*State) IsFunction

func (L *State) IsFunction(index int) bool

func (*State) IsGoFunction

func (L *State) IsGoFunction(index int) bool

func (*State) IsLightUserdata

func (L *State) IsLightUserdata(index int) bool

func (*State) IsNil

func (L *State) IsNil(index int) bool

func (*State) IsNone

func (L *State) IsNone(index int) bool

func (*State) IsNoneOrNil

func (L *State) IsNoneOrNil(index int) bool

func (*State) IsNumber

func (L *State) IsNumber(index int) bool

func (*State) IsString

func (L *State) IsString(index int) bool

func (*State) IsTable

func (L *State) IsTable(index int) bool

func (*State) IsThread

func (L *State) IsThread(index int) bool

func (*State) IsUserdata

func (L *State) IsUserdata(index int) bool

func (*State) LessThan

func (L *State) LessThan(index1, index2 int) bool

func (*State) Load

func (L *State) Load(reader Reader, data interface{}, chunkname string) int

func (*State) LoadFile

func (L *State) LoadFile(filename string) int

func (*State) LoadString

func (L *State) LoadString(s string) int

func (*State) NewMetaTable

func (L *State) NewMetaTable(tname string) bool

returns false if registry already contains key tname

func (*State) NewTable

func (L *State) NewTable()

func (*State) NewThread

func (L *State) NewThread() *State

func (*State) NewUserdata

func (L *State) NewUserdata(size uintptr) unsafe.Pointer

old style

func (*State) Next

func (L *State) Next(index int) int

func (*State) ObjLen

func (L *State) ObjLen(index int) uint

func (*State) OpenBase

func (L *State) OpenBase()

func (*State) OpenIO

func (L *State) OpenIO()

func (*State) OpenLibs

func (L *State) OpenLibs()

func (*State) OpenMath

func (L *State) OpenMath()

func (*State) OpenOS

func (L *State) OpenOS()

func (*State) OpenPackage

func (L *State) OpenPackage()

func (*State) OpenString

func (L *State) OpenString()

func (*State) OpenTable

func (L *State) OpenTable()

func (*State) OptInteger

func (L *State) OptInteger(narg int, d int) int

func (*State) OptNumber

func (L *State) OptNumber(narg int, d float64) float64

func (*State) OptString

func (L *State) OptString(narg int, d string) string

func (*State) PCall

func (L *State) PCall(nargs int, nresults int, errfunc int) int

func (*State) Pop

func (L *State) Pop(n int)

func (*State) PushBoolean

func (L *State) PushBoolean(b bool)

func (*State) PushGoFunction

func (L *State) PushGoFunction(f GoFunction)

func (*State) PushInteger

func (L *State) PushInteger(n int)

func (*State) PushLightInteger

func (L *State) PushLightInteger(n int)

func (*State) PushLightUserdata

func (L *State) PushLightUserdata(ud *interface{})

push pointer by value, as a value - we don't impact lifetime

func (*State) PushNil

func (L *State) PushNil()

func (*State) PushNumber

func (L *State) PushNumber(n float64)

func (*State) PushString

func (L *State) PushString(str string)

func (*State) PushThread

func (L *State) PushThread() (isMain bool)

func (*State) PushValue

func (L *State) PushValue(index int)

func (*State) RawEqual

func (L *State) RawEqual(index1 int, index2 int) bool

func (*State) RawGet

func (L *State) RawGet(index int)

func (*State) RawGeti

func (L *State) RawGeti(index int, n int)

func (*State) RawSet

func (L *State) RawSet(index int)

func (*State) RawSeti

func (L *State) RawSeti(index int, n int)

func (*State) Ref

func (L *State) Ref(t int) int

func (*State) Register

func (L *State) Register(name string, f GoFunction)

func (*State) Remove

func (L *State) Remove(index int)

func (*State) Replace

func (L *State) Replace(index int)

func (*State) Resume

func (L *State) Resume(narg int) int

func (*State) SetAllocf

func (L *State) SetAllocf(f Alloc)

func (*State) SetField

func (L *State) SetField(index int, k string)

func (*State) SetGlobal

func (L *State) SetGlobal(name string)

func (*State) SetMetaTable

func (L *State) SetMetaTable(index int)

func (*State) SetTable

func (L *State) SetTable(index int)

func (*State) SetTop

func (L *State) SetTop(index int)

func (*State) SetfEnv

func (L *State) SetfEnv(index int)

func (*State) Status

func (L *State) Status() int

func (*State) ToBoolean

func (L *State) ToBoolean(index int) bool

func (*State) ToGoFunction

func (L *State) ToGoFunction(index int) (f GoFunction)

func (*State) ToInteger

func (L *State) ToInteger(index int) int

func (*State) ToLightInteger

func (L *State) ToLightInteger(index int) int

func (*State) ToNumber

func (L *State) ToNumber(index int) float64

func (*State) ToPointer

func (L *State) ToPointer(index int) uintptr

func (*State) ToString

func (L *State) ToString(index int) string

func (*State) ToThread

func (L *State) ToThread(index int) *State

func (*State) ToUserdata

func (L *State) ToUserdata(index int) unsafe.Pointer

func (*State) Type

func (L *State) Type(index int) int

func (*State) Typename

func (L *State) Typename(tp int) string

func (*State) Yield

func (L *State) Yield(nresults int) int

type Writer

type Writer func(L *State, p []byte, ud interface{})

like lua_Writer, but as p will contain capacity, not needed as separate param

Jump to

Keyboard shortcuts

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