Documentation
¶
Overview ¶
Package section contains binary stream manipulation utilities.
Index ¶
- Constants
- func CopyStandardSection(w io.Writer, r reader.R, id Id, ...) (length int64, err error)
- func SkipCustomSections(r reader.R, customLoader func(Reader, uint32) error) (err error)
- type ByteRange
- type CustomLoaders
- type CustomMapping
- type FuncName
- type Id
- type Map
- type MappedNameSection
- type NameSection
- type Reader
Constants ¶
const ( Custom = module.SectionCustom Type = module.SectionType Import = module.SectionImport Function = module.SectionFunction Table = module.SectionTable Memory = module.SectionMemory Global = module.SectionGlobal Export = module.SectionExport Start = module.SectionStart Element = module.SectionElement Code = module.SectionCode Data = module.SectionData )
const CustomName = "name"
Variables ¶
This section is empty.
Functions ¶
func CopyStandardSection ¶ added in v0.8.0
func CopyStandardSection(w io.Writer, r reader.R, id Id, customLoader func(r Reader, payloadLen uint32) error) (length int64, err error)
CopyStandardSection with the given type if one is found. The returned length includes the copied section's header and payload (everything that was written). Custom sections preceding the standard section are processed by customLoader (or discarded if it's nil) - they are not included in the returned length. If another standard 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 standard section is encountered, zero length and io.EOF are returned. io.EOF is returned only when it occurs between sections.
func SkipCustomSections ¶ added in v0.8.0
SkipCustomSections until the next standard section. The skipped sections are processed by customLoader (or discarded if it's nil). If no standard section is encountered, io.EOF is returned. io.EOF is returned only when it occurs between sections.
Types ¶
type CustomLoaders ¶ added in v0.8.0
type CustomMapping ¶ added in v0.8.0
type CustomMapping ByteRange
type Map ¶ added in v0.8.0
type Map struct {
Sections [module.NumSections]ByteRange
}
Map of section positions within the WebAssebly binary module. Offset and Length are nonzero if a section is present. Sections[Custom] holds information about the last (or latest) custom section.
type MappedNameSection ¶ added in v0.8.0
type MappedNameSection struct {
NameSection
Mapping ByteRange
}