binary

package
v0.0.0-...-5105380 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	LUA_SIGNATURE    = "\x1bLua"
	LUAC_VERSION     = 0x53
	LUAC_FORMAT      = 0
	LUAC_DATA        = "\x19\x93\r\n\x1a\n"
	CINT_SIZE        = 4
	CSIZET_SIZE      = 8
	INSTRUCTION_SIZE = 4
	LUA_INTEGER_SIZE = 8
	LUA_NUMBER_SIZE  = 8
	LUAC_INT         = 0x5678
	LUAC_NUM         = 370.5
)
View Source
const (
	LUA_TYPE_NONE = iota - 1
	LUA_TYPE_NIL
	LUA_TYPE_BOOL
	LUA_TYPE_LUDATA
	LUA_TYPE_NUMBER
	LUA_TYPE_STRING
	LUA_TYPE_TABLE
	LUA_TYPE_FUNC
	LUA_TYPE_UDATA
	LUA_TYPE_THREAD
)
View Source
const (
	LUA_NUM_FLOAT  = LUA_TYPE_NUMBER | (0 << 4) // floating-point numbers
	LUA_NUM_INT    = LUA_TYPE_NUMBER | (1 << 4) // integer numbers
	LUA_STR_SHORT  = LUA_TYPE_STRING | (0 << 4) // short strings
	LUA_STR_LONG   = LUA_TYPE_STRING | (1 << 4) // long strings
	LUA_CLOSURE    = LUA_TYPE_FUNC | (0 << 4)   // lua closure
	LUA_GO_FUNC    = LUA_TYPE_FUNC | (1 << 4)   // light go func
	LUA_GO_CLOSURE = LUA_TYPE_FUNC | (2 << 4)   // go closure
)

lua-5.3.4/src/lobject.h

Variables

This section is empty.

Functions

func Dump

func Dump(proto *Prototype, strip bool) []byte

func IsChunk

func IsChunk(data []byte) bool

Types

type Chunk

type Chunk struct {
	Header Header
	Entry  Prototype
}

func Load

func Load(data []byte) (chunk Chunk, err error)
type Header struct {
	Signature  [4]byte
	Version    byte
	Format     byte
	LuacData   [6]byte
	GoIntSize  byte
	SizetSize  byte
	InstrSize  byte
	LuaIntSize byte
	LuaNumSize byte
	LuacIntEnc int64
	LuacNumEnc float64
}

type LocalVar

type LocalVar struct {
	Name string
	Live uint32
	Dead uint32
}

type Prototype

type Prototype struct {
	Source   string
	SrcPos   uint32
	EndPos   uint32
	Params   byte
	Vararg   byte
	Stack    byte
	Code     []uint32
	Consts   []interface{}
	UpValues []UpValue
	Protos   []Prototype
	PcLnTab  []uint32
	Locals   []LocalVar
	UpNames  []string
}

func (*Prototype) Const

func (proto *Prototype) Const(index int) interface{}

func (*Prototype) IsVararg

func (proto *Prototype) IsVararg() bool

func (*Prototype) NumParams

func (proto *Prototype) NumParams() int

func (*Prototype) Proto

func (proto *Prototype) Proto(index int) *Prototype

func (*Prototype) StackSize

func (proto *Prototype) StackSize() int

type UpValue

type UpValue struct {
	InStack byte
	Index   byte
}

func (*UpValue) AtIndex

func (upval *UpValue) AtIndex() int

func (*UpValue) IsLocal

func (upval *UpValue) IsLocal() bool

Jump to

Keyboard shortcuts

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