encoding

package
v0.0.0-...-d05d51b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MagicHeader = 0xbd57a496
View Source
const (
	NEG1 = ^(uint64)(0)
)

Variables

View Source
var UnexceptMagicHeader = errors.New("Unexcept magic header")

Functions

func BytesToUint16

func BytesToUint16(buf []byte) uint16

func BytesToUint24

func BytesToUint24(buf []byte) uint32

func BytesToUint32

func BytesToUint32(buf []byte) uint32

func BytesToUint64

func BytesToUint64(buf []byte) uint64

func BytesToUint8

func BytesToUint8(buf []byte) uint8

func MustReadUint16

func MustReadUint16(r io.Reader) (v uint16)

func MustReadUint24

func MustReadUint24(r io.Reader) (v uint32)

func MustReadUint32

func MustReadUint32(r io.Reader) (v uint32)

func MustReadUint64

func MustReadUint64(r io.Reader) (v uint64)

func MustReadUint8

func MustReadUint8(r io.Reader) (v uint8)

func ReadByte2

func ReadByte2(r io.Reader) (a, b byte, err error)

func ReadByte3

func ReadByte3(r io.Reader) (a, b, c byte, err error)

func ReadByte4

func ReadByte4(r io.Reader) (a, b, c, d byte, err error)

func ReadByteAndUint16

func ReadByteAndUint16(r io.Reader) (a byte, v uint16, err error)

func ReadUint16

func ReadUint16(r io.Reader) (v uint16, err error)

func ReadUint24

func ReadUint24(r io.Reader) (v uint32, err error)

func ReadUint32

func ReadUint32(r io.Reader) (v uint32, err error)

func ReadUint64

func ReadUint64(r io.Reader) (v uint64, err error)

func ReadUint8

func ReadUint8(r io.Reader) (v uint8, err error)

func Uint16ToBytes

func Uint16ToBytes(v uint16, buf []byte) []byte

func Uint24ToBytes

func Uint24ToBytes(v uint32, buf []byte) []byte

func Uint24ToInt24

func Uint24ToInt24(v uint32) int32

func Uint32ToBytes

func Uint32ToBytes(v uint32, buf []byte) []byte

func Uint64ToBytes

func Uint64ToBytes(v uint64, buf []byte) []byte

func Uint8ToBytes

func Uint8ToBytes(v uint8, buf []byte) []byte

Types

type Gob

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

The type of a program

func NewGob

func NewGob(path string, code io.ReaderAt) *Gob

func (*Gob) Labels

func (g *Gob) Labels() (labels []LabelMeta)

func (*Gob) Lookup

func (g *Gob) Lookup(label string) (meta LabelMeta, ok bool)

func (*Gob) Name

func (g *Gob) Name() string

func (*Gob) ParseMetadata

func (g *Gob) ParseMetadata() (err error)

func (*Gob) Path

func (g *Gob) Path() string

func (*Gob) Program

func (g *Gob) Program() io.ReaderAt

func (*Gob) Strlst

func (g *Gob) Strlst() string

type Gop

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

func OpenGop

func OpenGop(path string) (p *Gop, err error)

func (*Gop) Close

func (p *Gop) Close() (err error)

func (*Gop) Init

func (p *Gop) Init() (err error)

func (*Gop) Open

func (p *Gop) Open(name string) (bf io.ReaderAt, err error)

type LabelMeta

type LabelMeta struct {
	Pkg    *Gob
	Name   string
	Offset int64
}

A structure that used to save metadata of labels(methods)

Jump to

Keyboard shortcuts

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