The binary-types Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The binary-types Reference Manual

This is the binary-types Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 10:48:46 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

-*- mode: text; coding: utf-8-unix; -*-

######################################################################
##
##    Copyright (C) 2001,2000, 2003
##    Department of Computer Science, University of Tromsø, Norway
##
## Filename:      README
## Author:        Frode Vatvedt Fjeld 
## Created at:    Wed Dec  8 15:35:53 1999
## Distribution:  See the accompanying file COPYING.
##
## $Id: README,v 1.1.1.1 2004/01/13 11:13:13 ffjeld Exp $
##
######################################################################

Binary-types is a Common Lisp package for reading and writing binary
files. Binary-types provides macros that are used to declare the
mapping between lisp objects and some binary (i.e. octet-based)
representation.

Supported kinds of binary types include:

 * Signed and unsigned integers of any octet-size, big-endian or
   little-endian. Maps to lisp integers.

 * Enumerated types based on any integer type. Maps to lisp symbols.

 * Complex bit-field types based on any integer type. Sub-fields can
   be numeric, enumerated, or bit-flags. Maps to lisp lists of symbols
   and integers.

 * Fixed-length and null-terminated strings. Maps to lisp strings.

 * Compound records of other binary types. Maps to lisp DEFCLASS
   classes or, when you prefer, DEFSTRUCT structs.

Typically, a complete binary record format/type can be specified in a
single (nested) declaration statement. Such compound records may then
be read and written with READ-BINARY and WRITE-BINARY.

Binary-types is *not* helpful in reading files with variable
bit-length code-words, such as most compressed file formats. It will
basically only work with file-formats based on 8-bit bytes
(octets). Also, at this time no floating-point types are supported out
of the box.

Binary types may now be declared with the DEFINE-BINARY-CLASS macro,
which has the same syntax (and semantics) as DEFCLASS, only there is
an additional slot-option (named :BINARY-TYPE) that declares that
slot's binary type. Note that the binary aspects of slots are *not*
inherited (the semantics of inheriting binary slots is unclear to me).

Another slot-option added by binary-types is :MAP-BINARY-WRITE, which
names a function (of two arguments) that is applied to the slot's
value and the name of the slot's binary-type in order to obtain the
value that is actually passed to WRITE-BINARY. Similarly,
:MAP-BINARY-READ takes a function that is to be applied to the binary
data and type-name when a record of that type is being read.  A
slightly modified version of :map-binary-read is
:MAP-BINARY-READ-DELAYED, which will do essentially the same thing as
:map-binary-read, only the mapping will be "on-demand": A slot-unbound
method will be created for this purpose.

A variation of the :BINARY-TYPE slot-option is :BINARY-LISP-TYPE,
which does everything :BINARY-TYPE does, but also passes on a :TYPE
slot-option to DEFCLASS (or DEFSTRUCT).  The type-spec is inferred
from the binary-type declaration. When using this mechanism, you
should be careful to always provide a legal value in the slot (as you
must always do when declaring slots' types). If you find this
confusing, just use :BINARY-TYPE.

Performance has not really been a concern for me while designing this
package. There's no obvious performance bottlenecks that I know of,
but keep in mind that all "binary" reads and writes are reduced to
individual 8-bit READ-BYTEs and WRITE-BYTEs. If you do identify
particular performance bottlenecks, let me know.

The included file "example.lisp" demonstrates how to use this
package. To give you a taste of what it looks like, the following
declarations are enough to read the header of an ELF executable file
with the form

   (let ((*endian* :big-endian))
     (read-binary 'elf-header stream)


;;; ELF basic type declarations
(define-unsigned word 4)
(define-signed sword  4)
(define-unsigned addr 4)
(define-unsigned off  4)
(define-unsigned half 2)

;;; ELF file header structure
(define-binary-class elf-header ()
  ((e-ident
    :binary-type (define-binary-struct e-ident ()
           (ei-magic nil :binary-type
                 (define-binary-struct ei-magic ()
                   (ei-mag0 0 :binary-type u8)
                   (ei-mag1 #\null :binary-type char8)
                   (ei-mag2 #\null :binary-type char8)
                   (ei-mag3 #\null :binary-type char8)))
           (ei-class nil :binary-type
                 (define-enum ei-class (u8)
                   elf-class-none 0
                   elf-class-32   1
                   elf-class-64   2))
           (ei-data nil :binary-type
                (define-enum ei-data (u8)
                  elf-data-none 0
                  elf-data-2lsb 1
                  elf-data-2msb 2))
           (ei-version 0 :binary-type u8)
           (padding nil :binary-type 1)
           (ei-name "" :binary-type
                (define-null-terminated-string ei-name 8))))
   (e-type
    :binary-type (define-enum e-type (half)
           et-none 0
           et-rel  1
           et-exec 2
           et-dyn  3
           et-core 4
           et-loproc #xff00
           et-hiproc #xffff))
   (e-machine
    :binary-type (define-enum e-machine (half)
           em-none  0
           em-m32   1
           em-sparc 2
           em-386   3
           em-68k   4
           em-88k   5
           em-860   7
           em-mips  8))
   (e-version   :binary-type word)
   (e-entry     :binary-type addr)
   (e-phoff     :binary-type off)
   (e-shoff     :binary-type off)
   (e-flags     :binary-type word)
   (e-ehsize    :binary-type half)
   (e-phentsize :binary-type half)
   (e-phnum     :binary-type half)
   (e-shentsize :binary-type half)
   (e-shnum     :binary-type half)
   (e-shstrndx  :binary-type half)))


For a second example, here's an approach to supporting floats:

  (define-bitfield ieee754-single-float (u32)
    (((:enum :byte (1 31))
       positive 0
       negative 1)
      ((:numeric exponent 8 23))
      ((:numeric significand 23 0))))




The postscript file "type-hierarchy.ps" shows the binary types
hierarchy.  It is generated using psgraph and closer-mop, which may be
loaded via Quicklisp as shown below:

    (ql:quickload "psgraph")
    (ql:quickload "closer-mop")

    (with-open-file (*standard-output* "type-hierarchy.ps"
                                       :direction :output
                                       :if-exists :supersede)
      (psgraph:psgraph *standard-output* 'binary-types::binary-type
                       (lambda (p)
                         (mapcar #'class-name
                                 (closer-mop:class-direct-subclasses
                                  (find-class p))))
                       (lambda (s) (list (symbol-name s)))
                       t))


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 binary-types

Maintainer

ffjeld@common-lisp.net

Author

Frode V. Fjeld

License

BSD-like, see accopanying file COPYING.

Description

A library for reading and writing binary records.

Source

binary-types.asd (file)

Component

binary-types.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 binary-types.asd

Location

binary-types.asd

Systems

binary-types (system)

Packages

binary-types-asd


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 binary-types/binary-types.lisp

Parent

binary-types (system)

Location

binary-types.lisp

Packages

binary-types

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 binary-types-asd

Source

binary-types.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 binary-types

Source

binary-types.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *binary-read-byte*

The low-level READ-BYTE function used by binary-types.

Package

binary-types

Source

binary-types.lisp (file)

Special Variable: *binary-write-byte*

The low-level WRITE-BYTE function used by binary-types.

Package

binary-types

Source

binary-types.lisp (file)

Special Variable: *endian*

*endian* must be (dynamically) bound to either :big-endian or :little-endian while reading endian-sensitive types.

Package

binary-types

Source

binary-types.lisp (file)

Special Variable: *padding-byte*

The value written to padding octets.

Package

binary-types

Source

binary-types.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: define-binary-class TYPE-NAME SUPERS SLOTS &rest CLASS-OPTIONS
Package

binary-types

Source

binary-types.lisp (file)

Macro: define-binary-string TYPE-NAME SIZE &key TERMINATORS
Package

binary-types

Source

binary-types.lisp (file)

Macro: define-binary-struct NAME-AND-OPTIONS DUMMY-OPTIONS &rest DOC-SLOT-DESCRIPTIONS
Package

binary-types

Source

binary-types.lisp (file)

Macro: define-bitfield TYPE-NAME (STORAGE-TYPE) SPEC
Package

binary-types

Source

binary-types.lisp (file)

Macro: define-enum TYPE-NAME (STORAGE-NAME &optional BYTE-SPEC) &rest SPEC

A simple wrapper around DEFINE-BITFIELD for simple enum types.

Package

binary-types

Source

binary-types.lisp (file)

Macro: define-null-terminated-string TYPE-NAME SIZE
Package

binary-types

Source

binary-types.lisp (file)

Macro: define-signed NAME SIZE &optional ENDIAN
Package

binary-types

Source

binary-types.lisp (file)

Macro: define-unsigned NAME SIZE &optional ENDIAN
Package

binary-types

Source

binary-types.lisp (file)

Macro: with-binary-file (STREAM-VAR PATH &rest KEY-ARGS) &body BODY

This is a thin wrapper around WITH-OPEN-FILE, that tries to set the stream’s element-type to that required by READ-BINARY and WRITE-BINARY. A run-time assertion on the stream’s actual element type is performed, unless you disable this feature by setting the keyword option :check-stream to nil.

Package

binary-types

Source

binary-types.lisp (file)

Macro: with-binary-input-from-list (STREAM-VAR LIST-FORM) &body BODY

Bind STREAM-VAR to an object that, when passed to READ-BINARY, provides 8-bit bytes from LIST-FORM, which must yield a list.
Binds *BINARY-READ-BYTE* appropriately. This macro will break if this binding is shadowed.

Package

binary-types

Source

binary-types.lisp (file)

Macro: with-binary-input-from-vector (STREAM-VAR VECTOR-FORM &key START) &body BODY

Bind STREAM-VAR to an object that, when passed to READ-BINARY, provides 8-bit bytes from VECTOR-FORM, which must yield a vector.
Binds *BINARY-READ-BYTE* appropriately. This macro will break if this binding is shadowed.

Package

binary-types

Source

binary-types.lisp (file)

Macro: with-binary-output-to-list (STREAM-VAR) &body BODY

Inside BODY, calls to WRITE-BINARY with stream STREAM-VAR will collect the individual 8-bit bytes in a list (of integers).
This list is returned by the form. (There is no way to get at
the return-value of BODY.)
This macro depends on the binding of *BINARY-WRITE-BYTE*, which should not be shadowed.

Package

binary-types

Source

binary-types.lisp (file)

Macro: with-binary-output-to-vector (STREAM-VAR &optional VECTOR-OR-SIZE-FORM &key ADJUSTABLE FILL-POINTER ELEMENT-TYPE ON-FULL-ARRAY) &body BODY

Arrange for STREAM-VAR to collect octets in a vector.
VECTOR-OR-SIZE-FORM is either a form that evaluates to a vector, or an integer in which case a new vector of that size is created. The vector’s fill-pointer is used as the write-index. If ADJUSTABLE nil (or not provided), an error will occur if the array is too small. Otherwise, the array will be adjusted in size, using VECTOR-PUSH-EXTEND. If ADJUSTABLE is an integer, that value will be passed as the EXTENSION argument to VECTOR-PUSH-EXTEND. If VECTOR-OR-SIZE-FORM is an integer, the created vector is returned, otherwise the value of BODY.

Package

binary-types

Source

binary-types.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: binary-record-slot-names TYPE &key PADDING-SLOTS-P MATCH-TAGS

Returns a list of the slot-names of TYPE, in sequence.

Package

binary-types

Source

binary-types.lisp (file)

Function: binary-slot-tags TYPE SLOT-NAME
Package

binary-types

Source

binary-types.lisp (file)

Function: binary-slot-type TYPE SLOT-NAME
Package

binary-types

Source

binary-types.lisp (file)

Function: binary-slot-value OBJECT SLOT-NAME

Return the “binary” value of a slot, i.e the value mapped by any MAP-ON-WRITE slot mapper function.

Package

binary-types

Source

binary-types.lisp (file)

Function: enum-symbolic-value TYPE BINARY-VALUE

The inverse of ENUM-VALUE.

Package

binary-types

Source

binary-types.lisp (file)

Function: enum-value TYPE SYMBOLIC-VALUE

For an enum type (actually, for any bitfield-based type), ~ look up the numeric value of a symbol.

Package

binary-types

Source

binary-types.lisp (file)

Function: find-binary-type NAME &optional ERRORP
Function: (setf find-binary-type) VALUE NAME
Package

binary-types

Source

binary-types.lisp (file)

Function: merge-bytes BYTES FROM-SIZE TO-SIZE

Combine BYTES sized FROM-SIZE bits into new bytes sized TO-SIZE bits.

Package

binary-types

Source

binary-types.lisp (file)

Function: read-binary-string STREAM &key SIZE TERMINATORS

Read a string from STREAM, terminated by any member of the list TERMINATORS. If SIZE is provided and non-nil, exactly SIZE octets are read, but the returned string is still terminated by TERMINATORS. The string and the number of octets read are returned.

Package

binary-types

Source

binary-types.lisp (file)

Function: slot-offset TYPE SLOT-NAME

Return the offset (in number of octets) of SLOT-NAME in TYPE.

Package

binary-types

Source

binary-types.lisp (file)

Function: split-bytes BYTES FROM-SIZE TO-SIZE

From a list of BYTES sized FROM-SIZE bits, split each byte into bytes of size TO-SIZE, according to *ENDIAN*. TO-SIZE must divide FROM-SIZE evenly. If this is not the case, you might want to apply MERGE-BYTES to the list of BYTES first.

Package

binary-types

Source

binary-types.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Generic functions

Generic Function: read-binary TYPE STREAM &key START STOP &allow-other-keys

Read an object of binary TYPE from STREAM.

Package

binary-types

Source

binary-types.lisp (file)

Methods
Method: read-binary (TYPE bitfield) STREAM &key &allow-other-keys
Method: read-binary (TYPE binary-record) STREAM &key START STOP &allow-other-keys
Method: read-binary (TYPE binary-string) STREAM &key &allow-other-keys
Method: read-binary (TYPE integer) STREAM &key &allow-other-keys
Method: read-binary (TYPE binary-char8) STREAM &key &allow-other-keys
Method: read-binary (TYPE binary-signed) STREAM &key &allow-other-keys
Method: read-binary (TYPE binary-unsigned) STREAM &key &allow-other-keys
Method: read-binary (TYPE symbol) STREAM &rest KEY-ARGS
Generic Function: read-binary-record TYPE-NAME STREAM &key START STOP &allow-other-keys
Package

binary-types

Methods
Method: read-binary-record TYPE-NAME STREAM &key START STOP &allow-other-keys
Source

binary-types.lisp (file)

Generic Function: sizeof TYPE

Return the size in octets of the single argument TYPE, or nil if TYPE is not constant-sized.

Package

binary-types

Source

binary-types.lisp (file)

Methods
Method: sizeof (TYPE integer)
Method: sizeof (BINARY-TYPE binary-type)

automatically generated reader method

Method: sizeof (TYPE symbol)
Method: sizeof OBJ
Generic Function: write-binary TYPE STREAM OBJECT &key START STOP &allow-other-keys

Write an OBJECT of TYPE to STREAM.

Package

binary-types

Source

binary-types.lisp (file)

Methods
Method: write-binary (TYPE bitfield) STREAM SYMBOLIC-VALUE &rest KEY-ARGS
Method: write-binary (TYPE binary-record) STREAM OBJECT &key START STOP &allow-other-keys
Method: write-binary (TYPE binary-string) STREAM OBJ &key &allow-other-keys
Method: write-binary (TYPE integer) STREAM OBJECT &key &allow-other-keys
Method: write-binary (TYPE binary-char8) STREAM OBJECT &key &allow-other-keys
Method: write-binary (TYPE binary-integer) STREAM OBJECT &key &allow-other-keys
Method: write-binary (TYPE symbol) STREAM OBJECT &rest KEY-ARGS
Generic Function: write-binary-record OBJECT STREAM
Package

binary-types

Methods
Method: write-binary-record OBJECT STREAM
Source

binary-types.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.5 Types

Type: char8 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: endianess ()

These are the legal declarations of endianess. The value NIL
means that the endianess is determined by the dynamic value of *endian*.

Package

binary-types

Source

binary-types.lisp (file)

Type: s128 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: s16 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: s256 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: s32 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: s64 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: s8 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: u128 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: u16 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: u256 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: u32 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: u64 ()
Package

binary-types

Source

binary-types.lisp (file)

Type: u8 ()
Package

binary-types

Source

binary-types.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *binary-type-namespace*

Maps binary type’s names (which are symbols) to their binary-type class object.

Package

binary-types

Source

binary-types.lisp (file)

Special Variable: *ignore-hidden-slots-for-pcl*

Really ugly hack to allow older PCL-infested lisps to work in the precense of :map-binary-read-delayed.

Package

binary-types

Source

binary-types.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: define-fixed-size-nt-string TYPE-NAME SIZE
Package

binary-types

Source

binary-types.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: binary-record-alist OBJ

Returns an assoc-list representation of (the slots of) a binary record object.

Package

binary-types

Source

binary-types.lisp (file)

Function: bitfield-compute-numeric-value TYPE SYMBOLIC-VALUE

Returns the numeric representation of a bitfields symbolic value.

Package

binary-types

Source

binary-types.lisp (file)

Function: bitfield-compute-symbolic-value TYPE NUMERIC-VALUE

Return the symbolic value of a numeric bitfield

Package

binary-types

Source

binary-types.lisp (file)

Function: bitfield-entry-bytespec INSTANCE
Function: (setf bitfield-entry-bytespec) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: bitfield-entry-p OBJECT
Package

binary-types

Source

binary-types.lisp (file)

Function: bitfield-entry-value INSTANCE
Function: (setf bitfield-entry-value) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: calculate-sizeof SLOT-TYPES
Package

binary-types

Source

binary-types.lisp (file)

Function: copy-bitfield-entry INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: copy-record-slot INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: find-binary-type-name TYPE
Package

binary-types

Source

binary-types.lisp (file)

Function: make-bitfield-entry &key (VALUE VALUE) (BYTESPEC BYTESPEC)
Package

binary-types

Source

binary-types.lisp (file)

Function: make-pairs LIST

(make-pairs ’(1 2 3 4)) => ((1 . 2) (3 . 4))

Package

binary-types

Source

binary-types.lisp (file)

Function: make-record-slot &key (NAME NAME) (TYPE TYPE) (MAP-WRITE MAP-WRITE) (MAP-READ MAP-READ) (MAP-READ-DELAYED MAP-READ-DELAYED) (HIDDEN-READ-SLOT HIDDEN-READ-SLOT) (TAGS TAGS)
Package

binary-types

Source

binary-types.lisp (file)

Function: merge-binary-records OBJ1 OBJ2

Returns a record where every non-bound slot in obj1 is replaced with that slot’s value from obj2.

Package

binary-types

Source

binary-types.lisp (file)

Function: parse-bt-spec EXPR

Takes a binary-type specifier (a symbol, integer, or define-xx form),
and returns three values: the binary-type’s name, the equivalent lisp type, and any nested declaration that must be expanded separately.

Package

binary-types

Source

binary-types.lisp (file)

Function: quoted-name-p FORM
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-hidden-read-slot INSTANCE
Function: (setf record-slot-hidden-read-slot) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-map-read INSTANCE
Function: (setf record-slot-map-read) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-map-read-delayed INSTANCE
Function: (setf record-slot-map-read-delayed) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-map-write INSTANCE
Function: (setf record-slot-map-write) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-name INSTANCE
Function: (setf record-slot-name) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-p OBJECT
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-tags INSTANCE
Function: (setf record-slot-tags) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)

Function: record-slot-type INSTANCE
Function: (setf record-slot-type) VALUE INSTANCE
Package

binary-types

Source

binary-types.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Generic functions

Generic Function: binary-integer-endian OBJECT
Package

binary-types

Methods
Method: binary-integer-endian (BINARY-INTEGER binary-integer)

automatically generated reader method

Source

binary-types.lisp (file)

Generic Function: binary-record-make-instance TYPE
Package

binary-types

Methods
Method: binary-record-make-instance (TYPE binary-struct)
Source

binary-types.lisp (file)

Method: binary-record-make-instance (TYPE binary-class)
Source

binary-types.lisp (file)

Generic Function: binary-record-slot-offset OBJECT
Package

binary-types

Methods
Method: binary-record-slot-offset (BINARY-RECORD binary-record)

automatically generated reader method

Source

binary-types.lisp (file)

Generic Function: binary-record-slots OBJECT
Generic Function: (setf binary-record-slots) NEW-VALUE OBJECT
Package

binary-types

Methods
Method: binary-record-slots (BINARY-RECORD binary-record)

automatically generated reader method

Source

binary-types.lisp (file)

Method: (setf binary-record-slots) NEW-VALUE (BINARY-RECORD binary-record)

automatically generated writer method

Source

binary-types.lisp (file)

Generic Function: binary-string-terminators OBJECT
Package

binary-types

Methods
Method: binary-string-terminators (BINARY-STRING binary-string)

automatically generated reader method

Source

binary-types.lisp (file)

Generic Function: binary-type-name OBJECT
Package

binary-types

Methods
Method: binary-type-name (BINARY-TYPE binary-type)

automatically generated reader method

Source

binary-types.lisp (file)

Generic Function: bitfield-hash OBJECT
Generic Function: (setf bitfield-hash) NEW-VALUE OBJECT
Package

binary-types

Methods
Method: bitfield-hash (BITFIELD bitfield)

automatically generated reader method

Source

binary-types.lisp (file)

Method: (setf bitfield-hash) NEW-VALUE (BITFIELD bitfield)

automatically generated writer method

Source

binary-types.lisp (file)

Generic Function: storage-type OBJECT
Generic Function: (setf storage-type) NEW-VALUE OBJECT
Package

binary-types

Methods
Method: storage-type (BITFIELD bitfield)

automatically generated reader method

Source

binary-types.lisp (file)

Method: (setf storage-type) NEW-VALUE (BITFIELD bitfield)

automatically generated writer method

Source

binary-types.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Structures

Structure: bitfield-entry ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: value
Readers

bitfield-entry-value (function)

Writers

(setf bitfield-entry-value) (function)

Slot: bytespec
Readers

bitfield-entry-bytespec (function)

Writers

(setf bitfield-entry-bytespec) (function)

Structure: record-slot ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods

make-load-form (method)

Direct slots
Slot: name
Readers

record-slot-name (function)

Writers

(setf record-slot-name) (function)

Slot: type
Readers

record-slot-type (function)

Writers

(setf record-slot-type) (function)

Slot: map-write
Readers

record-slot-map-write (function)

Writers

(setf record-slot-map-write) (function)

Slot: map-read
Readers

record-slot-map-read (function)

Writers

(setf record-slot-map-read) (function)

Slot: map-read-delayed
Readers

record-slot-map-read-delayed (function)

Writers

(setf record-slot-map-read-delayed) (function)

Slot: hidden-read-slot
Readers

record-slot-hidden-read-slot (function)

Writers

(setf record-slot-hidden-read-slot) (function)

Slot: tags
Readers

record-slot-tags (function)

Writers

(setf record-slot-tags) (function)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.6 Classes

Class: binary-char8 ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-type (class)

Direct methods
Class: binary-class ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-record (class)

Direct methods

binary-record-make-instance (method)

Direct slots
Slot: instance-class
Type

standard-class

Initargs

binary-types::instance-class

Class: binary-integer ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-type (class)

Direct subclasses
Direct methods
Direct slots
Slot: endian
Type

binary-types:endianess

Initargs

binary-types::endian

Readers

binary-integer-endian (generic function)

Class: binary-record ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-type (class)

Direct subclasses
Direct methods
Direct slots
Slot: slots
Initargs

binary-types::slots

Readers

binary-record-slots (generic function)

Writers

(setf binary-record-slots) (generic function)

Slot: offset
Initargs

binary-types::offset

Readers

binary-record-slot-offset (generic function)

Class: binary-signed ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-integer (class)

Direct methods

read-binary (method)

Class: binary-string ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-type (class)

Direct methods
Direct slots
Slot: terminators
Initargs

binary-types::terminators

Readers

binary-string-terminators (generic function)

Class: binary-struct ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-record (class)

Direct methods

binary-record-make-instance (method)

Direct slots
Slot: constructor
Initargs

binary-types::constructor

Class: binary-type ()

BINARY-TYPE is the base class for binary types meta-classes.

Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: name
Initargs

binary-types::name

Initform

(quote #:anonymous-binary-type)

Readers

binary-type-name (generic function)

Slot: sizeof
Initargs

binary-types:sizeof

Readers

sizeof (generic function)

Class: binary-unsigned ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-integer (class)

Direct methods

read-binary (method)

Class: bitfield ()
Package

binary-types

Source

binary-types.lisp (file)

Direct superclasses

binary-type (class)

Direct methods
Direct slots
Slot: storage-type
Initargs

binary-types::storage-type

Readers

storage-type (generic function)

Writers

(setf storage-type) (generic function)

Slot: hash
Type

hash-table

Initform

(make-hash-table :test (function eq))

Readers

bitfield-hash (generic function)

Writers

(setf bitfield-hash) (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   B   F   L  
Index Entry  Section

B
binary-types.asd: The binary-types<dot>asd file
binary-types/binary-types.lisp: The binary-types/binary-types<dot>lisp file

F
File, Lisp, binary-types.asd: The binary-types<dot>asd file
File, Lisp, binary-types/binary-types.lisp: The binary-types/binary-types<dot>lisp file

L
Lisp File, binary-types.asd: The binary-types<dot>asd file
Lisp File, binary-types/binary-types.lisp: The binary-types/binary-types<dot>lisp file

Jump to:   B   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
B   C   D   E   F   G   M   P   Q   R   S   W  
Index Entry  Section

(
(setf binary-record-slots): Internal generic functions
(setf binary-record-slots): Internal generic functions
(setf bitfield-entry-bytespec): Internal functions
(setf bitfield-entry-value): Internal functions
(setf bitfield-hash): Internal generic functions
(setf bitfield-hash): Internal generic functions
(setf find-binary-type): Exported functions
(setf record-slot-hidden-read-slot): Internal functions
(setf record-slot-map-read): Internal functions
(setf record-slot-map-read-delayed): Internal functions
(setf record-slot-map-write): Internal functions
(setf record-slot-name): Internal functions
(setf record-slot-tags): Internal functions
(setf record-slot-type): Internal functions
(setf storage-type): Internal generic functions
(setf storage-type): Internal generic functions

B
binary-integer-endian: Internal generic functions
binary-integer-endian: Internal generic functions
binary-record-alist: Internal functions
binary-record-make-instance: Internal generic functions
binary-record-make-instance: Internal generic functions
binary-record-make-instance: Internal generic functions
binary-record-slot-names: Exported functions
binary-record-slot-offset: Internal generic functions
binary-record-slot-offset: Internal generic functions
binary-record-slots: Internal generic functions
binary-record-slots: Internal generic functions
binary-slot-tags: Exported functions
binary-slot-type: Exported functions
binary-slot-value: Exported functions
binary-string-terminators: Internal generic functions
binary-string-terminators: Internal generic functions
binary-type-name: Internal generic functions
binary-type-name: Internal generic functions
bitfield-compute-numeric-value: Internal functions
bitfield-compute-symbolic-value: Internal functions
bitfield-entry-bytespec: Internal functions
bitfield-entry-p: Internal functions
bitfield-entry-value: Internal functions
bitfield-hash: Internal generic functions
bitfield-hash: Internal generic functions

C
calculate-sizeof: Internal functions
copy-bitfield-entry: Internal functions
copy-record-slot: Internal functions

D
define-binary-class: Exported macros
define-binary-string: Exported macros
define-binary-struct: Exported macros
define-bitfield: Exported macros
define-enum: Exported macros
define-fixed-size-nt-string: Internal macros
define-null-terminated-string: Exported macros
define-signed: Exported macros
define-unsigned: Exported macros

E
enum-symbolic-value: Exported functions
enum-value: Exported functions

F
find-binary-type: Exported functions
find-binary-type-name: Internal functions
Function, (setf bitfield-entry-bytespec): Internal functions
Function, (setf bitfield-entry-value): Internal functions
Function, (setf find-binary-type): Exported functions
Function, (setf record-slot-hidden-read-slot): Internal functions
Function, (setf record-slot-map-read): Internal functions
Function, (setf record-slot-map-read-delayed): Internal functions
Function, (setf record-slot-map-write): Internal functions
Function, (setf record-slot-name): Internal functions
Function, (setf record-slot-tags): Internal functions
Function, (setf record-slot-type): Internal functions
Function, binary-record-alist: Internal functions
Function, binary-record-slot-names: Exported functions
Function, binary-slot-tags: Exported functions
Function, binary-slot-type: Exported functions
Function, binary-slot-value: Exported functions
Function, bitfield-compute-numeric-value: Internal functions
Function, bitfield-compute-symbolic-value: Internal functions
Function, bitfield-entry-bytespec: Internal functions
Function, bitfield-entry-p: Internal functions
Function, bitfield-entry-value: Internal functions
Function, calculate-sizeof: Internal functions
Function, copy-bitfield-entry: Internal functions
Function, copy-record-slot: Internal functions
Function, enum-symbolic-value: Exported functions
Function, enum-value: Exported functions
Function, find-binary-type: Exported functions
Function, find-binary-type-name: Internal functions
Function, make-bitfield-entry: Internal functions
Function, make-pairs: Internal functions
Function, make-record-slot: Internal functions
Function, merge-binary-records: Internal functions
Function, merge-bytes: Exported functions
Function, parse-bt-spec: Internal functions
Function, quoted-name-p: Internal functions
Function, read-binary-string: Exported functions
Function, record-slot-hidden-read-slot: Internal functions
Function, record-slot-map-read: Internal functions
Function, record-slot-map-read-delayed: Internal functions
Function, record-slot-map-write: Internal functions
Function, record-slot-name: Internal functions
Function, record-slot-p: Internal functions
Function, record-slot-tags: Internal functions
Function, record-slot-type: Internal functions
Function, slot-offset: Exported functions
Function, split-bytes: Exported functions

G
Generic Function, (setf binary-record-slots): Internal generic functions
Generic Function, (setf bitfield-hash): Internal generic functions
Generic Function, (setf storage-type): Internal generic functions
Generic Function, binary-integer-endian: Internal generic functions
Generic Function, binary-record-make-instance: Internal generic functions
Generic Function, binary-record-slot-offset: Internal generic functions
Generic Function, binary-record-slots: Internal generic functions
Generic Function, binary-string-terminators: Internal generic functions
Generic Function, binary-type-name: Internal generic functions
Generic Function, bitfield-hash: Internal generic functions
Generic Function, read-binary: Exported generic functions
Generic Function, read-binary-record: Exported generic functions
Generic Function, sizeof: Exported generic functions
Generic Function, storage-type: Internal generic functions
Generic Function, write-binary: Exported generic functions
Generic Function, write-binary-record: Exported generic functions

M
Macro, define-binary-class: Exported macros
Macro, define-binary-string: Exported macros
Macro, define-binary-struct: Exported macros
Macro, define-bitfield: Exported macros
Macro, define-enum: Exported macros
Macro, define-fixed-size-nt-string: Internal macros
Macro, define-null-terminated-string: Exported macros
Macro, define-signed: Exported macros
Macro, define-unsigned: Exported macros
Macro, with-binary-file: Exported macros
Macro, with-binary-input-from-list: Exported macros
Macro, with-binary-input-from-vector: Exported macros
Macro, with-binary-output-to-list: Exported macros
Macro, with-binary-output-to-vector: Exported macros
make-bitfield-entry: Internal functions
make-pairs: Internal functions
make-record-slot: Internal functions
merge-binary-records: Internal functions
merge-bytes: Exported functions
Method, (setf binary-record-slots): Internal generic functions
Method, (setf bitfield-hash): Internal generic functions
Method, (setf storage-type): Internal generic functions
Method, binary-integer-endian: Internal generic functions
Method, binary-record-make-instance: Internal generic functions
Method, binary-record-make-instance: Internal generic functions
Method, binary-record-slot-offset: Internal generic functions
Method, binary-record-slots: Internal generic functions
Method, binary-string-terminators: Internal generic functions
Method, binary-type-name: Internal generic functions
Method, bitfield-hash: Internal generic functions
Method, read-binary: Exported generic functions
Method, read-binary: Exported generic functions
Method, read-binary: Exported generic functions
Method, read-binary: Exported generic functions
Method, read-binary: Exported generic functions
Method, read-binary: Exported generic functions
Method, read-binary: Exported generic functions
Method, read-binary: Exported generic functions
Method, read-binary-record: Exported generic functions
Method, sizeof: Exported generic functions
Method, sizeof: Exported generic functions
Method, sizeof: Exported generic functions
Method, sizeof: Exported generic functions
Method, storage-type: Internal generic functions
Method, write-binary: Exported generic functions
Method, write-binary: Exported generic functions
Method, write-binary: Exported generic functions
Method, write-binary: Exported generic functions
Method, write-binary: Exported generic functions
Method, write-binary: Exported generic functions
Method, write-binary: Exported generic functions
Method, write-binary-record: Exported generic functions

P
parse-bt-spec: Internal functions

Q
quoted-name-p: Internal functions

R
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary-record: Exported generic functions
read-binary-record: Exported generic functions
read-binary-string: Exported functions
record-slot-hidden-read-slot: Internal functions
record-slot-map-read: Internal functions
record-slot-map-read-delayed: Internal functions
record-slot-map-write: Internal functions
record-slot-name: Internal functions
record-slot-p: Internal functions
record-slot-tags: Internal functions
record-slot-type: Internal functions

S
sizeof: Exported generic functions
sizeof: Exported generic functions
sizeof: Exported generic functions
sizeof: Exported generic functions
sizeof: Exported generic functions
slot-offset: Exported functions
split-bytes: Exported functions
storage-type: Internal generic functions
storage-type: Internal generic functions

W
with-binary-file: Exported macros
with-binary-input-from-list: Exported macros
with-binary-input-from-vector: Exported macros
with-binary-output-to-list: Exported macros
with-binary-output-to-vector: Exported macros
write-binary: Exported generic functions
write-binary: Exported generic functions
write-binary: Exported generic functions
write-binary: Exported generic functions
write-binary: Exported generic functions
write-binary: Exported generic functions
write-binary: Exported generic functions
write-binary: Exported generic functions
write-binary-record: Exported generic functions
write-binary-record: Exported generic functions

Jump to:   (  
B   C   D   E   F   G   M   P   Q   R   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
B   C   E   H   I   M   N   O   S   T   V  
Index Entry  Section

*
*binary-read-byte*: Exported special variables
*binary-type-namespace*: Internal special variables
*binary-write-byte*: Exported special variables
*endian*: Exported special variables
*ignore-hidden-slots-for-pcl*: Internal special variables
*padding-byte*: Exported special variables

B
bytespec: Internal structures

C
constructor: Internal classes

E
endian: Internal classes

H
hash: Internal classes
hidden-read-slot: Internal structures

I
instance-class: Internal classes

M
map-read: Internal structures
map-read-delayed: Internal structures
map-write: Internal structures

N
name: Internal structures
name: Internal classes

O
offset: Internal classes

S
sizeof: Internal classes
Slot, bytespec: Internal structures
Slot, constructor: Internal classes
Slot, endian: Internal classes
Slot, hash: Internal classes
Slot, hidden-read-slot: Internal structures
Slot, instance-class: Internal classes
Slot, map-read: Internal structures
Slot, map-read-delayed: Internal structures
Slot, map-write: Internal structures
Slot, name: Internal structures
Slot, name: Internal classes
Slot, offset: Internal classes
Slot, sizeof: Internal classes
Slot, slots: Internal classes
Slot, storage-type: Internal classes
Slot, tags: Internal structures
Slot, terminators: Internal classes
Slot, type: Internal structures
Slot, value: Internal structures
slots: Internal classes
Special Variable, *binary-read-byte*: Exported special variables
Special Variable, *binary-type-namespace*: Internal special variables
Special Variable, *binary-write-byte*: Exported special variables
Special Variable, *endian*: Exported special variables
Special Variable, *ignore-hidden-slots-for-pcl*: Internal special variables
Special Variable, *padding-byte*: Exported special variables
storage-type: Internal classes

T
tags: Internal structures
terminators: Internal classes
type: Internal structures

V
value: Internal structures

Jump to:   *  
B   C   E   H   I   M   N   O   S   T   V  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   E   P   R   S   T   U  
Index Entry  Section

B
binary-char8: Internal classes
binary-class: Internal classes
binary-integer: Internal classes
binary-record: Internal classes
binary-signed: Internal classes
binary-string: Internal classes
binary-struct: Internal classes
binary-type: Internal classes
binary-types: The binary-types system
binary-types: The binary-types package
binary-types-asd: The binary-types-asd package
binary-unsigned: Internal classes
bitfield: Internal classes
bitfield-entry: Internal structures

C
char8: Exported types
Class, binary-char8: Internal classes
Class, binary-class: Internal classes
Class, binary-integer: Internal classes
Class, binary-record: Internal classes
Class, binary-signed: Internal classes
Class, binary-string: Internal classes
Class, binary-struct: Internal classes
Class, binary-type: Internal classes
Class, binary-unsigned: Internal classes
Class, bitfield: Internal classes

E
endianess: Exported types

P
Package, binary-types: The binary-types package
Package, binary-types-asd: The binary-types-asd package

R
record-slot: Internal structures

S
s128: Exported types
s16: Exported types
s256: Exported types
s32: Exported types
s64: Exported types
s8: Exported types
Structure, bitfield-entry: Internal structures
Structure, record-slot: Internal structures
System, binary-types: The binary-types system

T
Type, char8: Exported types
Type, endianess: Exported types
Type, s128: Exported types
Type, s16: Exported types
Type, s256: Exported types
Type, s32: Exported types
Type, s64: Exported types
Type, s8: Exported types
Type, u128: Exported types
Type, u16: Exported types
Type, u256: Exported types
Type, u32: Exported types
Type, u64: Exported types
Type, u8: Exported types

U
u128: Exported types
u16: Exported types
u256: Exported types
u32: Exported types
u64: Exported types
u8: Exported types

Jump to:   B   C   E   P   R   S   T   U