Versions in this module Expand all Collapse all v0 v0.2.4 Jul 30, 2026 v0.2.3 Jul 30, 2026 v0.2.2 Jul 30, 2026 v0.2.1 Jul 30, 2026 v0.2.0 Jul 30, 2026 Changes in this version + const MaxEvaluationWords + const MaxLocals + const MaxPC + const MaxVersion + const MinVersion + var ErrInvalidFormat = errors.New("quetzal: invalid format") + var ErrLimitExceeded = errors.New("quetzal: resource limit exceeded") + var ErrStoryMismatch = errors.New("quetzal: story mismatch") + var ErrTruncated = errors.New("quetzal: truncated data") + var IDANNO = ID + var IDAUTH = ID + var IDCMem = ID + var IDCopy = ID + var IDFORM = ID + var IDIFZS = ID + var IDIFhd = ID + var IDIntD = ID + var IDStks = ID + var IDUMem = ID + func DecodeCMem(payload, original []byte) ([]byte, error) + func EncodeCMem(current, original []byte) ([]byte, error) + func EncodeStks(frames []Frame) ([]byte, error) + func StoryChecksum(data []byte) (checksum uint16, ok bool) + func ValidateFrames(frames []Frame, story Story) error + func Version() (pkg, spec string) + func Write(w io.Writer, story Story, save *Save, opts ...WriteOption) error + type Chunk struct + Data []byte + ID ID + type ChunkError struct + Err error + ID ID + Offset int64 + func (e *ChunkError) Error() string + func (e *ChunkError) Unwrap() error + type CompareOption func(*compareConfig) + func IgnoreChunks(ids ...ID) CompareOption + func IgnoreInterpreterHeader() CompareOption + func IgnoreMemoryEncoding() CompareOption + func IgnoreMemoryRange(start, end int) CompareOption + type Difference struct + A any + B any + Frame int + ID ID + Kind DifferenceKind + Offset int + func Compare(a, b *Save, opts ...CompareOption) []Difference + func CompareFiles(a, b *File, opts ...CompareOption) []Difference + func (d Difference) String() string + type DifferenceKind uint8 + const DiffArguments + const DiffChecksum + const DiffChunkCount + const DiffChunkData + const DiffChunkID + const DiffDiscardResult + const DiffEvaluationDepth + const DiffEvaluationValue + const DiffFrameCount + const DiffHeaderExtra + const DiffLocalCount + const DiffLocalValue + const DiffMemoryBytes + const DiffMemoryEncoding + const DiffMemorySize + const DiffProgramCounter + const DiffRelease + const DiffResultVariable + const DiffReturnPC + const DiffSerial + func (k DifferenceKind) String() string + type File struct + Chunks []Chunk + func Decode(r io.Reader, opts ...ReadOption) (*File, error) + func (f *File) All(id ID) []Chunk + func (f *File) Annotations() []string + func (f *File) Author() (string, bool) + func (f *File) Copyright() (string, bool) + func (f *File) First(id ID) (Chunk, bool) + func (f *File) Frames() ([]Frame, error) + func (f *File) Header() (Header, error) + func (f *File) Memory(story Story) (Memory, error) + func (f *File) Save(story Story) (*Save, error) + func (f *File) WriteTo(w io.Writer) (int64, error) + type Frame struct + Arguments uint8 + DiscardResult bool + Evaluation []uint16 + Locals []uint16 + ResultVariable byte + ReturnPC uint32 + func DecodeStks(payload []byte, limits Limits) ([]Frame, error) + func (f Frame) IsDummy() bool + func (f Frame) Validate() error + type FrameError struct + Err error + Index int + func (e *FrameError) Error() string + func (e *FrameError) Unwrap() error + type Header struct + Checksum uint16 + Extra []byte + PC uint32 + Release uint16 + Serial Serial + func ParseHeader(data []byte) (Header, error) + func (h Header) Encode() ([]byte, error) + func (h Header) Identity() Identity + func (h Header) Matches(story Story) bool + func (h Header) Validate() error + func (h Header) Verify(story Story) error + type ID [4]byte + func (id ID) String() string + type Identity struct + Checksum uint16 + Release uint16 + Serial Serial + func (i Identity) String() string + type InterpreterData struct + ContentsID byte + Data []byte + Flags byte + Interpreter ID + OperatingSystem ID + func ParseInterpreterData(payload []byte) (InterpreterData, error) + func (d InterpreterData) Copyable() bool + func (d InterpreterData) MachineSpecific() bool + func (d InterpreterData) PositionSpecific() bool + type Limits struct + MaxChunkBytes uint64 + MaxFormBytes uint64 + MaxFrames int + MaxStackWords int + MaxUnknownBytes uint64 + func DefaultLimits() Limits + type Memory struct + Data []byte + Encoding MemoryEncoding + func (m Memory) Encode(story Story) (Chunk, error) + func (m Memory) Validate(story Story) error + type MemoryEncoding uint8 + const MemoryCompressed + const MemoryUncompressed + func (e MemoryEncoding) String() string + type ReadOption func(*readConfig) + func IgnoreChunkOrder() ReadOption + func WithLimits(l Limits) ReadOption + type Save struct + Chunks []Chunk + Frames []Frame + Header Header + Memory Memory + func Read(r io.Reader, story Story, opts ...ReadOption) (*Save, error) + func (s *Save) Annotations() []string + func (s *Save) Author() (string, bool) + func (s *Save) Copyright() (string, bool) + func (s *Save) Encode(story Story, opts ...WriteOption) (*File, error) + func (s *Save) Validate(story Story) error + type Serial [6]byte + func (s Serial) String() string + type Story struct + Checksum uint16 + ChecksumComputed bool + DynamicMemory []byte + Release uint16 + Serial Serial + Version uint8 + func ParseStory(data []byte) (Story, error) + func (s Story) Identity() Identity + type StoryMismatchError struct + Save Identity + Story Identity + func (e *StoryMismatchError) Error() string + func (e *StoryMismatchError) Unwrap() error + type WriteOption func(*writeConfig) + func WithEncoding(e MemoryEncoding) WriteOption