lua

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 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          c.Int = -1
	NIL           c.Int = 0
	BOOLEAN       c.Int = 1
	LIGHTUSERDATA c.Int = 2
	NUMBER        c.Int = 3
	STRING        c.Int = 4
	TABLE         c.Int = 5
	FUNCTION      c.Int = 6
	USERDATA      c.Int = 7
	THREAD        c.Int = 8
	NUMTYPES      c.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 (
	EXTRASPACE = unsafe.Sizeof(uintptr(0))
)

@@ LUA_EXTRASPACE defines the size of a raw memory area associated with ** a Lua state with very fast access. ** CHANGE it if you need a different size.

View Source
const (
	IDSIZE = 60
)

@@ LUA_IDSIZE gives the maximum size for the description of the source ** of a function in debug information. ** CHANGE it if you want a different size.

View Source
const (
	LLGoPackage = "link: $(pkg-config --libs lua); -llua -lm"
)
View Source
const (
	MAXSTACK = 1000000
)
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'

View Source
const (
	NUMTAGS = NUMTYPES
)
View Source
const (
	REGISTRYINDEX = -MAXSTACK - 1000
)

Variables

This section is empty.

Functions

func Upvalueindex added in v0.9.7

func Upvalueindex(i c.Int) c.Int

Types

type Alloc added in v0.9.8

type Alloc func(ud c.Pointer, ptr c.Pointer, osize c.Ulong, nsize c.Ulong) c.Pointer

llgo:type C

type CFunction added in v0.9.4

type CFunction func(L *State) c.Int

llgo:type C

type CallInfo added in v0.9.8

type CallInfo struct {
	Unused [8]byte
}

type Debug added in v0.9.8

type Debug struct {
	Event           c.Int
	Name            *c.Char        /* (n) */
	Namewhat        *c.Char        /* (n) 'global', 'local', 'field', 'method' */
	What            *c.Char        /* (S) 'Lua', 'C', 'main', 'tail' */
	Source          *c.Char        /* (S) */
	Srclen          uintptr        /* (S) */
	Currentline     c.Int          /* (l) */
	Linedefined     c.Int          /* (S) */
	Lastlinedefined c.Int          /* (S) */
	Nups            byte           /* (u) number of upvalues */
	Nparams         byte           /* (u) number of parameters */
	Isvararg        c.Char         /* (u) */
	Istailcall      c.Char         /* (t) */
	Ftransfer       uint16         /* (r) index of first value transferred */
	Ntransfer       uint16         /* (r) number of transferred values */
	ShortSrc        [IDSIZE]c.Char /* (S) */
	/* private part */
	ICi *CallInfo
}

type Hook added in v0.9.8

type Hook func(L *State, ar *Debug)

llgo:type C

type Integer

type Integer = c.Int

type for integer functions

type KContext

type KContext = c.Pointer

type for continuation-function contexts

type KFunction

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

llgo:type C

type Number

type Number = c.Double

type of numbers in Lua

type Reader added in v0.9.7

type Reader func(L *State, ud c.Pointer, sz *c.Ulong) *c.Char

llgo:type C

type State

type State struct {
	Unused [8]byte
}

func Newstate__0 added in v0.9.8

func Newstate__0(f Alloc, ud c.Pointer) *State

llgo:link Newstate__0 C.lua_newstate

func Newstate__1 added in v0.9.8

func Newstate__1() *State

func (*State) Absindex added in v0.9.2

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

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

func (*State) Atpanic added in v0.9.7

func (L *State) Atpanic(panicf CFunction) CFunction

llgo:link (*State).Atpanic C.lua_atpanic

func (*State) Call added in v0.9.4

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

func (*State) Callk added in v0.9.4

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

llgo:link (*State).Callk C.lua_callk

func (*State) Checkinteger added in v0.9.7

func (L *State) Checkinteger(arg c.Int) Integer

llgo:link (*State).Checkinteger C.luaL_checkinteger

func (*State) Checknumber added in v0.9.7

func (L *State) Checknumber(arg c.Int) Number

llgo:link (*State).Checknumber C.luaL_checknumber

func (*State) Checkstack added in v0.9.2

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

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

func (*State) Close

func (L *State) Close()

llgo:link (*State).Close C.lua_close

func (*State) Closeslot added in v0.9.8

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

llgo:link (*State).Closeslot C.lua_closeslot

func (*State) Closethread added in v0.9.8

func (L *State) Closethread(from *State) c.Int

llgo:link (*State).Closethread C.lua_closethread

func (*State) Concat added in v0.9.8

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

llgo:link (*State).Concat C.lua_concat

func (*State) Copy

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

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

func (*State) Createtable added in v0.9.2

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

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

func (*State) Dofile added in v0.9.2

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

func (*State) Dostring added in v0.9.2

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

func (*State) Dump added in v0.9.7

func (L *State) Dump(writer Writer, data c.Pointer, strip c.Int) c.Int

llgo:link (*State).Dump C.lua_dump

func (*State) Error added in v0.9.7

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

llgo:link (*State).Error C.lua_error

func (*State) Gc added in v0.9.8

func (L *State) Gc(what c.Int, __llgo_va_list ...any) c.Int

llgo:link (*State).Gc C.lua_gc

func (*State) Getallocf added in v0.9.8

func (L *State) Getallocf(ud *c.Pointer) Alloc

llgo:link (*State).Getallocf C.lua_getallocf

func (*State) Getextraspace added in v0.9.8

func (L *State) Getextraspace() c.Pointer

func (*State) Getfield added in v0.9.2

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

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

func (*State) Getglobal added in v0.9.2

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

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

func (*State) Gethook added in v0.9.8

func (L *State) Gethook() Hook

llgo:link (*State).Gethook C.lua_gethook

func (*State) Gethookcount added in v0.9.8

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

llgo:link (*State).Gethookcount C.lua_gethookcount

func (*State) Gethookmask added in v0.9.8

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

llgo:link (*State).Gethookmask C.lua_gethookmask

func (*State) Geti added in v0.9.8

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

llgo:link (*State).Geti C.lua_geti

func (*State) Getinfo added in v0.9.8

func (L *State) Getinfo(what *c.Char, ar *Debug) c.Int

llgo:link (*State).Getinfo C.lua_getinfo

func (*State) Getiuservalue added in v0.9.8

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

llgo:link (*State).Getiuservalue C.lua_getiuservalue

func (*State) Getlocal added in v0.9.8

func (L *State) Getlocal(ar *Debug, n c.Int) *c.Char

llgo:link (*State).Getlocal C.lua_getlocal

func (*State) Getmetatable added in v0.9.4

func (L *State) Getmetatable(objindex c.Int) c.Int

llgo:link (*State).Getmetatable C.lua_getmetatable

func (*State) Getstack added in v0.9.8

func (L *State) Getstack(level c.Int, ar *Debug) c.Int

llgo:link (*State).Getstack C.lua_getstack

func (*State) Gettable added in v0.9.2

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

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

func (*State) Gettop added in v0.9.2

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

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

func (*State) Getupvalue added in v0.9.8

func (L *State) Getupvalue(funcindex c.Int, n c.Int) *c.Char

llgo:link (*State).Getupvalue C.lua_getupvalue

func (*State) Getuservalue added in v0.9.8

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

func (*State) Insert added in v0.9.7

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

func (*State) Isboolean added in v0.9.2

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

func (*State) Iscfunction added in v0.9.4

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

llgo:link (*State).Iscfunction C.lua_iscfunction

func (*State) Isfunction added in v0.9.2

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

func (*State) Isinteger added in v0.9.2

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

llgo:link (*State).Isinteger C.lua_isinteger

func (*State) Islightuserdata added in v0.9.2

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

func (*State) Isnil added in v0.9.2

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

func (*State) Isnone added in v0.9.2

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

func (*State) Isnoneornil added in v0.9.2

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

func (*State) Isnumber added in v0.9.2

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

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

func (*State) Isstring added in v0.9.2

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

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

func (*State) Istable added in v0.9.2

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

func (*State) Isthread added in v0.9.2

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

func (*State) Isuserdata added in v0.9.7

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

llgo:link (*State).Isuserdata C.lua_isuserdata

func (*State) Isyieldable added in v0.9.2

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

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

func (*State) LError added in v0.9.7

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

llgo:link (*State).LError C.luaL_error

func (*State) Len added in v0.9.8

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

llgo:link (*State).Len C.lua_len

func (*State) Load added in v0.9.7

func (L *State) Load(reader Reader, dt c.Pointer, chunkname *c.Char, mode *c.Char) c.Int

llgo:link (*State).Load C.lua_load

func (*State) Loadfile added in v0.9.2

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

func (*State) Loadfilex added in v0.9.2

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

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

func (*State) Loadstring added in v0.9.2

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

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

func (*State) Newtable added in v0.9.2

func (L *State) Newtable()

func (*State) Newthread added in v0.9.2

func (L *State) Newthread() *State

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

func (*State) Newuserdata added in v0.9.7

func (L *State) Newuserdata(sz uintptr) c.Pointer

func (*State) Newuserdatauv added in v0.9.7

func (L *State) Newuserdatauv(sz uintptr, nuvalue c.Int) c.Pointer

llgo:link (*State).Newuserdatauv C.lua_newuserdatauv

func (*State) Next

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

llgo:link (*State).Next C.lua_next

func (*State) Openlibs added in v0.9.2

func (L *State) Openlibs()

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

func (*State) Pcall added in v0.9.2

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

func (*State) Pcallk added in v0.9.2

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 added in v0.9.2

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

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

func (*State) Pushcclosure added in v0.9.4

func (L *State) Pushcclosure(fn CFunction, n c.Int)

llgo:link (*State).Pushcclosure C.lua_pushcclosure

func (*State) Pushcfunction added in v0.9.4

func (L *State) Pushcfunction(f CFunction)

func (*State) Pushfstring added in v0.9.2

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

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

func (*State) Pushglobaltable added in v0.9.8

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

func (*State) Pushinteger added in v0.9.2

func (L *State) Pushinteger(n Integer)

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

func (*State) Pushlightuserdata added in v0.9.7

func (L *State) Pushlightuserdata(p c.Pointer)

llgo:link (*State).Pushlightuserdata C.lua_pushlightuserdata

func (*State) Pushliteral added in v0.9.8

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

func (*State) Pushlstring added in v0.9.2

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

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

func (*State) Pushnil added in v0.9.2

func (L *State) Pushnil()

llgo:link (*State).Pushnil C.lua_pushnil

func (*State) Pushnumber added in v0.9.2

func (L *State) Pushnumber(n Number)

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

func (*State) Pushstring added in v0.9.2

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

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

func (*State) Pushthread added in v0.9.8

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

llgo:link (*State).Pushthread C.lua_pushthread

func (*State) Pushvalue added in v0.9.2

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

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

func (*State) Rawget added in v0.9.8

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

llgo:link (*State).Rawget C.lua_rawget

func (*State) Rawgeti added in v0.9.8

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

llgo:link (*State).Rawgeti C.lua_rawgeti

func (*State) Rawgetp added in v0.9.8

func (L *State) Rawgetp(idx c.Int, p c.Pointer) c.Int

llgo:link (*State).Rawgetp C.lua_rawgetp

func (*State) Rawset added in v0.9.8

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

llgo:link (*State).Rawset C.lua_rawset

func (*State) Rawseti added in v0.9.8

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

llgo:link (*State).Rawseti C.lua_rawseti

func (*State) Rawsetp added in v0.9.8

func (L *State) Rawsetp(idx c.Int, p c.Pointer)

llgo:link (*State).Rawsetp C.lua_rawsetp

func (*State) Register added in v0.9.7

func (L *State) Register(name *c.Char, f CFunction)

func (*State) Remove added in v0.9.7

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

func (*State) Replace added in v0.9.7

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

func (*State) Resetthread added in v0.9.8

func (L *State) Resetthread(from *State) c.Int

llgo:link (*State).Resetthread C.lua_resetthread

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) Setallocf added in v0.9.8

func (L *State) Setallocf(f Alloc, ud c.Pointer) Alloc

llgo:link (*State).Setallocf C.lua_setallocf

func (*State) Setcstacklimit added in v0.9.8

func (L *State) Setcstacklimit(limit c.Uint) c.Int

llgo:link (*State).Setcstacklimit C.lua_setcstacklimit

func (*State) Setfield added in v0.9.2

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

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

func (*State) Setglobal added in v0.9.2

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

llgo:link (*State).Setglobal C.lua_setglobal

func (*State) Sethook added in v0.9.8

func (L *State) Sethook(fn Hook, mask c.Int, count c.Int)

llgo:link (*State).Sethook C.lua_sethook

func (*State) Seti added in v0.9.8

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

llgo:link (*State).Seti C.lua_seti

func (*State) Setiuservalue added in v0.9.8

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

llgo:link (*State).Setiuservalue C.lua_setiuservalue

func (*State) Setlocal added in v0.9.8

func (L *State) Setlocal(ar *Debug, n c.Int) *c.Char

llgo:link (*State).Setlocal C.lua_setlocal

func (*State) Setmetatable added in v0.9.4

func (L *State) Setmetatable(objindex c.Int) c.Int

llgo:link (*State).Setmetatable C.lua_setmetatable

func (*State) Settable added in v0.9.2

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

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

func (*State) Settop added in v0.9.2

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

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

func (*State) Setupvalue added in v0.9.8

func (L *State) Setupvalue(funcindex c.Int, n c.Int) *c.Char

llgo:link (*State).Setupvalue C.lua_setupvalue

func (*State) Setuservalue added in v0.9.8

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

func (*State) Setwarnf added in v0.9.8

func (L *State) Setwarnf(f WarnFunction, ud c.Pointer)

llgo:link (*State).Setwarnf C.lua_setwarnf

func (*State) Status

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

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

func (*State) Stringtonumber added in v0.9.8

func (L *State) Stringtonumber(s *c.Char) c.Ulong

llgo:link (*State).Stringtonumber C.lua_stringtonumber

func (*State) Toboolean added in v0.9.2

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

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

func (*State) Tocfunction added in v0.9.4

func (L *State) Tocfunction(idx c.Int) CFunction

llgo:link (*State).Tocfunction C.lua_tocfunction

func (*State) Toclose added in v0.9.8

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

llgo:link (*State).Toclose C.lua_toclose

func (*State) Tointeger added in v0.9.2

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

func (*State) Tointegerx added in v0.9.2

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

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

func (*State) Tolstring added in v0.9.2

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

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

func (*State) Tonumber added in v0.9.2

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

func (*State) Tonumberx added in v0.9.2

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

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

func (*State) Topointer added in v0.9.8

func (L *State) Topointer(idx c.Int) c.Pointer

llgo:link (*State).Topointer C.lua_topointer

func (*State) Tostring added in v0.9.2

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

func (*State) Tothread added in v0.9.8

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

llgo:link (*State).Tothread C.lua_tothread

func (*State) Touserdata added in v0.9.7

func (L *State) Touserdata(idx c.Int) c.Pointer

llgo:link (*State).Touserdata C.lua_touserdata

func (*State) Type

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

llgo:link (*State).Type C.lua_type

func (*State) Typename added in v0.9.2

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

llgo:link (*State).Typename C.lua_typename

func (*State) Upvalueid added in v0.9.8

func (L *State) Upvalueid(fidx c.Int, n c.Int) c.Pointer

llgo:link (*State).Upvalueid C.lua_upvalueid

func (*State) Upvaluejoin added in v0.9.8

func (L *State) Upvaluejoin(fidx1 c.Int, n1 c.Int, fidx2 c.Int, n2 c.Int)

llgo:link (*State).Upvaluejoin C.lua_upvaluejoin

func (*State) Version added in v0.9.8

func (L *State) Version() Number

llgo:link (*State).Version C.lua_version

func (*State) Warning added in v0.9.8

func (L *State) Warning(msg *c.Char, tocont c.Int)

llgo:link (*State).Warning C.lua_warning

func (*State) Xmove added in v0.9.2

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

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

func (*State) Yield added in v0.9.4

func (L *State) Yield(nresults c.Int) c.Int

func (*State) Yieldk added in v0.9.4

func (L *State) Yieldk(nresults c.Int, ctx KContext, k KFunction) c.Int

llgo:link (*State).Yieldk C.lua_yieldk

type Unsigned

type Unsigned = c.Uint

unsigned integer type

type WarnFunction added in v0.9.8

type WarnFunction func(ud c.Pointer, msg c.Char, tocont c.Int)

llgo:type C

type Writer added in v0.9.7

type Writer func(L *State, p c.Pointer, sz c.Ulong, ud c.Pointer) c.Int

llgo:type C

Jump to

Keyboard shortcuts

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