lua

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK        = 0
	YIELD     = 1
	ERRRUN    = 2
	ERRSYNTAX = 3
	ERRMEM    = 4
	ERRERR    = 5
)

/* thread status */

View Source
const (
	NONE          = int(-1)
	NIL           = int(0)
	BOOLEAN       = int(1)
	LIGHTUSERDATA = int(2)
	NUMBER        = int(3)
	STRING        = int(4)
	TABLE         = int(5)
	FUNCTION      = int(6)
	USERDATA      = int(7)
	THREAD        = int(8)
	UMTYPES       = int(9)
)

/* ** basic types */

View Source
const (
	RIDX_MAINTHREAD = 1
	RIDX_GLOBALS    = 2
	RIDX_LAST       = RIDX_GLOBALS
)

/* predefined values in the registry */

View Source
const (
	GCSTOP       = 0
	GCRESTART    = 1
	GCCOLLECT    = 2
	GCCOUNT      = 3
	GCCOUNTB     = 4
	GCSTEP       = 5
	GCSETPAUSE   = 6
	GCSETSTEPMUL = 7
	GCISRUNNING  = 9
	GCGEN        = 10
	GCINC        = 11
)
View Source
const (
	HOOKCALL     = 0
	HOOKRET      = 1
	HOOKLINE     = 2
	HOOKCOUNT    = 3
	HOOKTAILCALL = 4
)
View Source
const (
	MASKCALL  = 1 << HOOKCOUNT
	MASKRET   = 1 << HOOKRET
	MASKLINE  = 1 << HOOKLINE
	MASKCOUNT = 1 << HOOKCOUNT
)
View Source
const (
	LLGoPackage = "link: $(pkg-config --libs lua); -llua -lm"
)
View Source
const (
	MINSTACK = 20
)

/* minimum Lua stack available to a C function */

View Source
const (
	MULTRET = -1
)

/* option for multiple returns in 'lua_pcall' and 'lua_call' */

Variables

This section is empty.

Functions

This section is empty.

Types

type Integer

type Integer = c.Int

type KContext

type KContext c.Int

/* type for continuation-function contexts */ TODO(zzy): Context may not be c.Int

type KFunction

type KFunction func(L *State, status c.Int, ctx KContext) c.Int

TODO(zzy): KFunction does not currently support

type Number

type Number = c.Double

/* type of numbers in Lua */

type State

type State struct {
	Unused [8]byte
}

func NewState

func NewState() *State

func (*State) AbsIndex

func (L *State) AbsIndex(idx c.Int) c.Int

llgo:link (*State).AbsIndex C.lua_absindex

func (*State) CheckStack

func (L *State) CheckStack(n c.Int) c.Int

llgo:link (*State).CheckStack C.lua_checkstack

func (*State) Close

func (L *State) Close()

/* ** state manipulation */ llgo:link (*State).Close C.lua_close

func (*State) Copy

func (L *State) Copy(fromidx c.Int, toidx c.Int)

llgo:link (*State).Copy C.lua_copy

func (*State) CreateTable

func (L *State) CreateTable(narr c.Int, nrec c.Int)

llgo:link (*State).CreateTable C.lua_createtable

func (*State) DoFile

func (L *State) DoFile(filename *c.Char) c.Int

func (*State) DoString

func (L *State) DoString(str *c.Char) c.Int

func (*State) GetField

func (L *State) GetField(idx c.Int, k *c.Char) c.Int

llgo:link (*State).GetField C.lua_getfield

func (*State) GetGlobal

func (L *State) GetGlobal(name *c.Char) c.Int

llgo:link (*State).GetGlobal C.lua_getglobal

func (*State) GetTable

func (L *State) GetTable(idx c.Int) c.Int

llgo:link (*State).GetTable C.lua_gettable

func (*State) GetTop

func (L *State) GetTop() c.Int

llgo:link (*State).GetTop C.lua_gettop

func (*State) IsBoolean

func (L *State) IsBoolean(n c.Int) bool

func (*State) IsFunction

func (L *State) IsFunction(n c.Int) bool

func (*State) IsInteger

func (L *State) IsInteger(idx c.Int) c.Int

/* ** access functions (stack -> C) */ LUA_API int (lua_isinteger) (State *L, int idx); llgo:link (*State).IsInteger C.lua_isinteger

func (*State) IsLightUserData

func (L *State) IsLightUserData(n c.Int) bool

func (*State) IsNil

func (L *State) IsNil(n c.Int) bool

func (*State) IsNone

func (L *State) IsNone(n c.Int) bool

func (*State) IsNoneOrNil

func (L *State) IsNoneOrNil(n c.Int) bool

func (*State) IsNumber

func (L *State) IsNumber(idx c.Int) c.Int

llgo:link (*State).IsNumber C.lua_isnumber

func (*State) IsString

func (L *State) IsString(idx c.Int) c.Int

llgo:link (*State).IsString C.lua_isstring

func (*State) IsTable

func (L *State) IsTable(n c.Int) bool

func (*State) IsThread

func (L *State) IsThread(n c.Int) bool

func (*State) IsYieldable

func (L *State) IsYieldable() c.Int

llgo:link (*State).IsYieldable C.lua_isyieldable

func (*State) LoadFile

func (L *State) LoadFile(filename *c.Char) c.Int

func (*State) LoadFilex

func (L *State) LoadFilex(filename *c.Char, mode *c.Char) c.Int

llgo:link (*State).LoadFilex C.luaL_loadfilex

func (*State) LoadString

func (L *State) LoadString(s *c.Char) c.Int

llgo:link (*State).LoadString C.luaL_loadstring

func (*State) NewTable

func (L *State) NewTable()

func (*State) NewThread

func (L *State) NewThread() *State

llgo:link (*State).NewThread C.lua_newthread

func (*State) Next

func (L *State) Next(idx c.Int) c.Int

/* ** miscellaneous functions */ llgo:link (*State).Next C.lua_next

func (*State) OpenLibs

func (L *State) OpenLibs()

llgo:link (*State).OpenLibs C.luaL_openlibs

func (*State) PCall

func (L *State) PCall(nargs c.Int, nresults c.Int, errfunc c.Int) c.Int

func (*State) PCallk

func (L *State) PCallk(nargs c.Int, nresults c.Int, errfunc c.Int, ctx KContext, k *KFunction) c.Int

llgo:link (*State).PCallk C.lua_pcallk

func (*State) Pop

func (L *State) Pop(n c.Int)

func (*State) PushBoolean

func (L *State) PushBoolean(b c.Int)

llgo:link (*State).PushBoolean C.lua_pushboolean

func (*State) PushFString

func (L *State) PushFString(format *c.Char, __llgo_va_list ...any) *c.Char

llgo:link (*State).PushFString C.lua_pushfstring

func (*State) PushInteger

func (L *State) PushInteger(n Integer)

llgo:link (*State).PushInteger C.lua_pushinteger

func (*State) PushLString

func (L *State) PushLString(s *c.Char, len c.Ulong) *c.Char

llgo:link (*State).PushLString C.lua_pushlstring

func (*State) PushNil

func (L *State) PushNil()

/* ** push functions (C -> stack) */ llgo:link (*State).PushNil C.lua_pushnil

func (*State) PushNumber

func (L *State) PushNumber(n Number)

llgo:link (*State).PushNumber C.lua_pushnumber

func (*State) PushString

func (L *State) PushString(s *c.Char) *c.Char

llgo:link (*State).PushString C.lua_pushstring

func (*State) PushValue

func (L *State) PushValue(idx c.Int)

llgo:link (*State).PushValue C.lua_pushvalue

func (*State) Resume

func (L *State) Resume(from *State, narg c.Int, nres *c.Int) c.Int

llgo:link (*State).Resume C.lua_resume

func (*State) Rotate

func (L *State) Rotate(idx c.Int, n c.Int)

llgo:link (*State).Rotate C.lua_rotate

func (*State) SetField

func (L *State) SetField(idx c.Int, k *c.Char)

llgo:link (*State).SetField C.lua_setfield

func (*State) SetGlobal

func (L *State) SetGlobal(name *c.Char)

TODO(zzy):add to demo llgo:link (*State).SetGlobal C.lua_setglobal

func (*State) SetTable

func (L *State) SetTable(idx c.Int)

llgo:link (*State).SetTable C.lua_settable

func (*State) SetTop

func (L *State) SetTop(idx c.Int)

llgo:link (*State).SetTop C.lua_settop

func (*State) Status

func (L *State) Status() c.Int

llgo:link (*State).Status C.lua_status

func (*State) ToBoolean

func (L *State) ToBoolean(idx c.Int) bool

llgo:link (*State).ToBoolean C.lua_toboolean

func (*State) ToInteger

func (L *State) ToInteger(idx c.Int) Integer

func (*State) ToIntegerx

func (L *State) ToIntegerx(idx c.Int, isnum *c.Int) Integer

llgo:link (*State).ToIntegerx C.lua_tointegerx

func (*State) ToLString

func (L *State) ToLString(idx c.Int, len *c.Ulong) *c.Char

llgo:link (*State).ToLString C.lua_tolstring

func (*State) ToNumber

func (L *State) ToNumber(idx c.Int) Number

func (*State) ToNumberx

func (L *State) ToNumberx(idx c.Int, isnum *c.Int) Number

llgo:link (*State).ToNumberx C.lua_tonumberx

func (*State) ToString

func (L *State) ToString(idx c.Int) *c.Char

func (*State) Type

func (L *State) Type(idx c.Int) c.Int

TODO(zzy):add to demo llgo:link (*State).Type C.lua_type

func (*State) TypeName

func (L *State) TypeName(tp c.Int) *c.Char

TODO(zzy) llgo:link (*State).TypeName C.lua_typename

func (*State) XMove

func (L *State) XMove(to *State, n c.Int)

llgo:link (*State).XMove C.lua_xmove

type Unsigned

type Unsigned = c.Uint

/* unsigned integer type */

Directories

Path Synopsis
_demo
coroutine command
error command
funccall-concat command
funccall-number command
funccall-string command
hello command
loadcall command
stack command
table command

Jump to

Keyboard shortcuts

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