section

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func CopyKnownSection added in v0.6.0

func CopyKnownSection(w io.Writer, r reader.R, id Id, unknownLoader func(r Reader, payloadLen uint32) error) (length int64, err error)

CopyKnownSection with the given type if one is found. The returned length includes the copied section's header and payload (everything that was written). Unknown sections preceding the known section are processed by unknownLoader (or discarded if it's nil) - they are not included in the returned length. If another known section type is found, it is left untouched (the reader will be backed up before the section id) and zero length is returned. If no known section is encountered, zero length and io.EOF are returned. io.EOF is returned only when it occurs between sections.

Types

type FuncName added in v0.3.1

type FuncName struct {
	FunName    string   // TODO: rename?
	LocalNames []string // TODO: map?
}

type Id added in v0.6.0

type Id = module.SectionId

type NameSection

type NameSection struct {
	ModuleName string
	FuncNames  []FuncName // TODO: map? rename?
}

func (*NameSection) Load

func (ns *NameSection) Load(_ string, r reader.R) (err error)

Load "name" custom section.

type Reader added in v0.6.0

type Reader = reader.R

type UnknownLoader

type UnknownLoader func(sectionName string, section Reader) error

type UnknownLoaders

type UnknownLoaders map[string]UnknownLoader

func (UnknownLoaders) Load

func (uls UnknownLoaders) Load(r Reader, payloadLen uint32) (err error)

Jump to

Keyboard shortcuts

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