lua54

package
v0.0.0-...-290725f Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionMajor   = C.LUA_VERSION_MAJOR
	VersionMinor   = C.LUA_VERSION_MINOR
	VersionRelease = C.LUA_VERSION_RELEASE

	VersionNum        = C.LUA_VERSION_NUM
	VersionReleaseNum = C.LUA_VERSION_RELEASE_NUM

	Version   = C.LUA_VERSION
	Release   = C.LUA_RELEASE
	Copyright = C.LUA_COPYRIGHT
	Authors   = C.LUA_AUTHORS
)
View Source
const (
	RegistryIndexMainThread int64 = C.LUA_RIDX_MAINTHREAD
	RegistryIndexGlobals    int64 = C.LUA_RIDX_GLOBALS
)
View Source
const (
	LoadedTable  = C.LUA_LOADED_TABLE
	PreloadTable = C.LUA_PRELOAD_TABLE
)
View Source
const (
	GName = C.LUA_GNAME

	CoroutineLibraryName = C.LUA_COLIBNAME
	TableLibraryName     = C.LUA_TABLIBNAME
	IOLibraryName        = C.LUA_IOLIBNAME
	OSLibraryName        = C.LUA_OSLIBNAME
	StringLibraryName    = C.LUA_STRLIBNAME
	UTF8LibraryName      = C.LUA_UTF8LIBNAME
	MathLibraryName      = C.LUA_MATHLIBNAME
	DebugLibraryName     = C.LUA_DBLIBNAME
	PackageLibraryName   = C.LUA_LOADLIBNAME
)
View Source
const (
	ErrRun    int = C.LUA_ERRRUN
	ErrMem    int = C.LUA_ERRMEM
	ErrErr    int = C.LUA_ERRERR
	ErrSyntax int = C.LUA_ERRSYNTAX
	Yield     int = C.LUA_YIELD
)
View Source
const MultipleReturns int = C.LUA_MULTRET
View Source
const RegistryIndex int = C.LUA_REGISTRYINDEX

Variables

This section is empty.

Functions

func AsError

func AsError(err error) (code int, ok bool)

func NewMetatable

func NewMetatable(l *State, tname string) bool

NewMetatable is the auxlib NewMetatable function.

func PushOpenBase

func PushOpenBase(l *State)

func PushOpenCoroutine

func PushOpenCoroutine(l *State)

func PushOpenDebug

func PushOpenDebug(l *State)

func PushOpenMath

func PushOpenMath(l *State)

func PushOpenPackage

func PushOpenPackage(l *State)

func PushOpenString

func PushOpenString(l *State)

func PushOpenTable

func PushOpenTable(l *State)

func PushOpenUTF8

func PushOpenUTF8(l *State)

func UpvalueIndex

func UpvalueIndex(i int) int

Types

type ActivationRecord

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

func (*ActivationRecord) Info

func (ar *ActivationRecord) Info(what string) *Debug

type Debug

type Debug struct {
	Name            string
	NameWhat        string
	What            string
	Source          string
	ShortSource     string
	CurrentLine     int
	LineDefined     int
	LastLineDefined int
	NumUpvalues     uint8
	NumParams       uint8
	IsVararg        bool
	IsTailCall      bool
}

type Function

type Function = func(*State) (int, error)

type State

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

func (*State) AbsIndex

func (l *State) AbsIndex(idx int) int

func (*State) Call

func (l *State) Call(nArgs, nResults, msgHandler int) error

func (*State) CheckStack

func (l *State) CheckStack(n int) bool

func (*State) Close

func (l *State) Close() error

func (*State) Copy

func (l *State) Copy(fromIdx, toIdx int)

func (*State) CopyUserdata

func (l *State) CopyUserdata(dst []byte, idx, start int) int

func (*State) CreateTable

func (l *State) CreateTable(nArr, nRec int)

func (*State) Dump

func (l *State) Dump(w io.Writer, strip bool) (int64, error)

func (*State) Field

func (l *State) Field(idx int, k string, msgHandler int) (Type, error)

func (*State) GC

func (l *State) GC()

func (*State) GCCount

func (l *State) GCCount() int64

func (*State) GCGenerational

func (l *State) GCGenerational(minorMul, majorMul int)

func (*State) GCIncremental

func (l *State) GCIncremental(pause, stepMul, stepSize int)

func (*State) GCRestart

func (l *State) GCRestart()

func (*State) GCStep

func (l *State) GCStep(stepSize int)

func (*State) GCStop

func (l *State) GCStop()

func (*State) Global

func (l *State) Global(name string, msgHandler int) (Type, error)

func (*State) Info

func (l *State) Info(what string) *Debug

func (*State) Insert

func (l *State) Insert(idx int)

func (*State) IsBoolean

func (l *State) IsBoolean(idx int) bool

func (*State) IsFunction

func (l *State) IsFunction(idx int) bool

func (*State) IsGCRunning

func (l *State) IsGCRunning() bool

func (*State) IsInteger

func (l *State) IsInteger(idx int) bool

func (*State) IsNativeFunction

func (l *State) IsNativeFunction(idx int) bool

func (*State) IsNil

func (l *State) IsNil(idx int) bool

func (*State) IsNone

func (l *State) IsNone(idx int) bool

func (*State) IsNoneOrNil

func (l *State) IsNoneOrNil(idx int) bool

func (*State) IsNumber

func (l *State) IsNumber(idx int) bool

func (*State) IsString

func (l *State) IsString(idx int) bool

func (*State) IsTable

func (l *State) IsTable(idx int) bool

func (*State) IsThread

func (l *State) IsThread(idx int) bool

func (*State) IsUserdata

func (l *State) IsUserdata(idx int) bool

func (*State) Len

func (l *State) Len(idx int, msgHandler int) error

func (*State) Load

func (l *State) Load(r io.Reader, chunkName string, mode string) error

func (*State) LoadString

func (l *State) LoadString(s string, chunkName string, mode string) error

func (*State) Metatable

func (l *State) Metatable(idx int) bool

func (*State) NewUserdataUV

func (l *State) NewUserdataUV(size, nUValue int)

func (*State) Next

func (l *State) Next(idx int) bool

func (*State) Pop

func (l *State) Pop(n int)

func (*State) PushBoolean

func (l *State) PushBoolean(b bool)

func (*State) PushClosure

func (l *State) PushClosure(n int, f Function)

func (*State) PushInteger

func (l *State) PushInteger(n int64)

func (*State) PushLightUserdata

func (l *State) PushLightUserdata(p uintptr)

func (*State) PushNil

func (l *State) PushNil()

func (*State) PushNumber

func (l *State) PushNumber(n float64)

func (*State) PushString

func (l *State) PushString(s string)

func (*State) PushValue

func (l *State) PushValue(idx int)

func (*State) RawEqual

func (l *State) RawEqual(idx1, idx2 int) bool

func (*State) RawField

func (l *State) RawField(idx int, k string) Type

func (*State) RawGet

func (l *State) RawGet(idx int) Type

func (*State) RawIndex

func (l *State) RawIndex(idx int, n int64) Type

func (*State) RawLen

func (l *State) RawLen(idx int) uint64

func (*State) RawSet

func (l *State) RawSet(idx int)

func (*State) RawSetField

func (l *State) RawSetField(idx int, k string)

func (*State) RawSetIndex

func (l *State) RawSetIndex(idx int, n int64)

func (*State) Remove

func (l *State) Remove(idx int)

func (*State) Replace

func (l *State) Replace(idx int)

func (*State) Rotate

func (l *State) Rotate(idx, n int)

func (*State) SetField

func (l *State) SetField(idx int, k string, msgHandler int) error

func (*State) SetGlobal

func (l *State) SetGlobal(name string, msgHandler int) error

func (*State) SetMetatable

func (l *State) SetMetatable(objIndex int)

func (*State) SetTable

func (l *State) SetTable(idx, msgHandler int) error

func (*State) SetTop

func (l *State) SetTop(idx int)

func (*State) SetUserValue

func (l *State) SetUserValue(idx int, n int) bool

func (*State) SetUserdata

func (l *State) SetUserdata(idx int, start int, src []byte)

func (*State) Stack

func (l *State) Stack(level int) *ActivationRecord

func (*State) Table

func (l *State) Table(idx, msgHandler int) (Type, error)

func (*State) ToBoolean

func (l *State) ToBoolean(idx int) bool

func (*State) ToInteger

func (l *State) ToInteger(idx int) (n int64, ok bool)

func (*State) ToNumber

func (l *State) ToNumber(idx int) (n float64, ok bool)

func (*State) ToPointer

func (l *State) ToPointer(idx int) uintptr

func (*State) ToString

func (l *State) ToString(idx int) (s string, ok bool)

func (*State) Top

func (l *State) Top() int

func (*State) Type

func (l *State) Type(idx int) Type

func (*State) UserValue

func (l *State) UserValue(idx int, n int) Type

type Type

type Type C.int
const (
	TypeNone          Type = C.LUA_TNONE
	TypeNil           Type = C.LUA_TNIL
	TypeBoolean       Type = C.LUA_TBOOLEAN
	TypeLightUserdata Type = C.LUA_TLIGHTUSERDATA
	TypeNumber        Type = C.LUA_TNUMBER
	TypeString        Type = C.LUA_TSTRING
	TypeTable         Type = C.LUA_TTABLE
	TypeFunction      Type = C.LUA_TFUNCTION
	TypeUserdata      Type = C.LUA_TUSERDATA
	TypeThread        Type = C.LUA_TTHREAD
)

func Metatable

func Metatable(l *State, tname string) Type

Metatable is the auxlib Metatable function.

func (Type) String

func (tp Type) String() string

Jump to

Keyboard shortcuts

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