lua

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 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
	UMTYPES       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 (
	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 (
	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 CFunction added in v0.9.4

type CFunction func(L *State) c.Int

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

func Newstate() *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()

/* ** 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 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) 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) Getmetatable added in v0.9.4

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

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

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) 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) 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

/* ** miscellaneous functions */ 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) 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) 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()

/* ** push functions (C -> stack) */ 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) Pushvalue added in v0.9.2

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

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

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) 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 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) 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) Status

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

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

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

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

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) 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 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