modulereader

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package modulereader implements binary wasm reader statemachine that simple reads binary code into internal representation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	P uint64
	R io.Reader
}

Reader is generalised module reader context and tokenizer

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

Read implements io.Reader

func (*Reader) ReadByte

func (r *Reader) ReadByte() (byte, error)

ReadByte just one byte

func (*Reader) ReadBytes

func (r *Reader) ReadBytes(n int) ([]byte, error)

ReadBytes reads n bytes

func (*Reader) ReadDataSegment

func (r *Reader) ReadDataSegment() (types.DataSegment, error)

ReadDataSegment reads one segment

func (*Reader) ReadElementSegment

func (r *Reader) ReadElementSegment() (types.ElementSegment, error)

ReadElementSegment reads one element

func (*Reader) ReadExportEntry

func (r *Reader) ReadExportEntry() (types.ExportEntry, error)

ReadExportEntry reads one export entry

func (*Reader) ReadFunction

func (r *Reader) ReadFunction() (types.FunctionSig, error)

ReadFunction reads function signature

func (*Reader) ReadFunctionBody

func (r *Reader) ReadFunctionBody() (types.FunctionBody, error)

ReadFunctionBody reads whole function

func (*Reader) ReadGlobalEntry

func (r *Reader) ReadGlobalEntry() (types.GlobalEntry, error)

ReadGlobalEntry reads one entry of globals

func (*Reader) ReadGlobalVar

func (r *Reader) ReadGlobalVar() (*types.GlobalVar, error)

ReadGlobalVar reads global var

func (*Reader) ReadImportEntry

func (r *Reader) ReadImportEntry() (types.Import, error)

ReadImportEntry reads one generic import entry

func (*Reader) ReadInitExpr

func (r *Reader) ReadInitExpr() ([]byte, error)

ReadInitExpr reads init code

func (Reader) ReadLocalEntry

func (r Reader) ReadLocalEntry() (types.LocalEntry, error)

ReadLocalEntry reads one locals entry

func (*Reader) ReadMemory

func (r *Reader) ReadMemory() (*types.Memory, error)

ReadMemory reads memory stub

func (*Reader) ReadResizableLimits

func (r *Reader) ReadResizableLimits() (*types.ResizableLimits, error)

ReadResizableLimits reads ResizableLimits object

func (*Reader) ReadString

func (r *Reader) ReadString(n int) (string, error)

ReadString reads n bytes as string

func (*Reader) ReadTable

func (r *Reader) ReadTable() (*types.Table, error)

ReadTable reads table stub

func (*Reader) ReadU32

func (r *Reader) ReadU32() (uint32, error)

ReadU32 reads 4 bytes as uint32

func (*Reader) ReadValueType

func (r *Reader) ReadValueType() (types.Value, error)

ReadValueType reads valuetype

func (*Reader) ReadVarUint32

func (r *Reader) ReadVarUint32() (uint32, error)

ReadVarUint32 reads uint32

func (*Reader) ReadVarUint32Size

func (r *Reader) ReadVarUint32Size() (res uint32, size uint, err error)

ReadVarUint32Size reads leb128 uint

func (*Reader) ReadVarint32

func (r *Reader) ReadVarint32() (int32, error)

ReadVarint32 reads int32

func (*Reader) ReadVarint32Size

func (r *Reader) ReadVarint32Size() (res int32, size uint, err error)

ReadVarint32Size reads int

func (*Reader) ReadVarint64Size

func (r *Reader) ReadVarint64Size() (res int64, size uint, err error)

ReadVarint64Size reads int64

Jump to

Keyboard shortcuts

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