The lisp-binary Reference Manual

Table of Contents

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

The lisp-binary Reference Manual

This is the lisp-binary Reference Manual, version 1, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 09:11:39 2019 GMT+0.


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

1 Introduction

lisp-binary

A library to easily read and write complex binary formats.

(Jump to Documentation)

LISP-BINARY provides the DEFBINARY macro, with which you can declare the structure of some piece of binary data, whether it's a file format, a network protocol, or what have you.

It is similar in spirit to Binary-Types and Kaitai Struct, but more powerful.

Quick demo:

(defpackage :instant-compressor
  (:use :common-lisp :lisp-binary)
  (:documentation "A file compressor written in 20 minutes. 7-bit ASCII only."))

(defbinary compressed-text ()
  (magic "IZ" :type (magic :actual-type (terminated-string 1)
                            :value "IZ"))
  (n-chars 0 :type (unsigned-byte 32))
  (buffer 0 :type (simple-array (unsigned-byte 7) (n-chars))))


(defun compress-file (in-filename out-filename)
  (with-open-binary-file (in in-filename
                             :direction :input)
    (let* ((file-size (file-length in))
           (buffer (read-bytes file-size in)))
      (with-open-binary-file (out-raw out-filename
                                      :direction :output
                                      :if-exists :supersede)
        (with-wrapped-in-bit-stream (out out-raw :byte-order :big-endian)
          ;; Notice the lack of a compression algorithm. The compression is done
          ;; entirely by the bit stream and the buffer's 7-bit element-type.
          (write-binary (make-compressed-text :n-chars file-size
                                              :buffer (make-array file-size
                                                                  :element-type '(unsigned-byte 7)
                                                                  :initial-contents (coerce buffer 'list)))
                        out))))))
    
(defun decompress-file (in-filename out-filename)
  (with-open-binary-file (in-raw in-filename
                             :direction :input)
    (with-wrapped-in-bit-stream (in in-raw :byte-order :big-endian)
      (with-open-binary-file (out out-filename
                                  :direction :output
                                  :if-exists :supersede)
        (write-bytes (slot-value (read-binary 'compressed-text in) 'buffer) out)))))

The DEFBINARY macro generates a DEFSTRUCT form to contain the data, and instances of the methods READ-BINARY and WRITE-BINARY, which read the data from a stream.

The DEFBINARY macro can generate code to automatically read and write the following types of data:

It is also possible to declare fields whose type isn't chosen until runtime, and fields that have custom reader and writer functions. With these features, this library can be used to both read and write nearly any binary format.

Both byte orders are supported for all data types, and the byte order can be declared either statically or dynamically (so that it changes as the file is read-- required by a number of formats, including TIFF).

LISP-BINARY also provides:


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 lisp-binary

Author

Jeremy Phelps

License

GPLv3

Description

Declare binary formats as structs and then read and write them.

Version

1

Dependencies
Source

lisp-binary.asd (file)

Components

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 lisp-binary.asd

Location

lisp-binary.asd

Systems

lisp-binary (system)


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

3.1.2 lisp-binary/binary-1.lisp

Dependencies
Parent

lisp-binary (system)

Location

binary-1.lisp

Packages

lisp-binary

Exported Definitions
Internal Definitions

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

3.1.3 lisp-binary/binary-2.lisp

Dependencies
Parent

lisp-binary (system)

Location

binary-2.lisp

Exported Definitions

defbinary (macro)

Internal Definitions

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

3.1.4 lisp-binary/simple-bit-stream.lisp

Dependency

integer.lisp (file)

Parent

lisp-binary (system)

Location

simple-bit-stream.lisp

Packages

simple-bit-stream

Exported Definitions
Internal Definitions

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

3.1.5 lisp-binary/reverse-stream.lisp

Dependency

integer.lisp (file)

Parent

lisp-binary (system)

Location

reverse-stream.lisp

Packages

reverse-stream

Exported Definitions
Internal Definitions

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

3.1.6 lisp-binary/integer.lisp

Dependency

utils.lisp (file)

Parent

lisp-binary (system)

Location

integer.lisp

Packages

lisp-binary/integer

Exported Definitions

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

3.1.7 lisp-binary/float.lisp

Dependency

integer.lisp (file)

Parent

lisp-binary (system)

Location

float.lisp

Packages

lisp-binary/float

Exported Definitions
Internal Definitions

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

3.1.8 lisp-binary/utils.lisp

Parent

lisp-binary (system)

Location

utils.lisp

Packages

lisp-binary-utils

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 lisp-binary

Read binary data directly into structs, and write it back out again. Also provides a lower-level API for reading and writing integers and floating-point numbers. Also provides a bit-stream API.

Source

binary-1.lisp (file)

Use List
Exported Definitions
Internal Definitions

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

4.2 simple-bit-stream

Source

simple-bit-stream.lisp (file)

Use List
Used By List

lisp-binary

Exported Definitions
Internal Definitions

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

4.3 reverse-stream

A stream that reads from another stream and reverses the bit order
of each byte so that the low-order bit becomes the high-order bit and vice versa.

This functionality is called for by the TIFF file format, because "It is easy and inexpensive for writers to reverse bit order by using a 256-byte lookup table." It is devillishly tricky to include this functionality directly in the DEFBINARY macro, however, when the macro was written without gratuitous bit-reversal in mind.

The REVERSE-STREAM does not keep track of any file positioning information. That means it can coexist with its client stream, and you can mix reads and/or writes between the two.

REVERSE-STREAM is not limited to 8-bit bytes. It can handle any byte size that the underlying Lisp implementation supports. On PC hardware, some Lisps can read byte sizes that are multiples of 8 bits, such as (UNSIGNED-BYTE 24).

Source

reverse-stream.lisp (file)

Use List
Exported Definitions
Internal Definitions

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

4.4 lisp-binary/integer

Source

integer.lisp (file)

Use List
Used By List
Exported Definitions

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

4.5 lisp-binary/float

Source

float.lisp (file)

Use List
Used By List

lisp-binary

Exported Definitions
Internal Definitions

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

4.6 lisp-binary-utils

Source

utils.lisp (file)

Use List
Used By List
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: *byte-order*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: +inf
Package

lisp-binary/float

Source

float.lisp (file)

Special Variable: -inf
Package

lisp-binary/float

Source

float.lisp (file)

Special Variable: pointer
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: quiet-nan
Package

lisp-binary/float

Source

float.lisp (file)

Special Variable: signalling-nan
Package

lisp-binary/float

Source

float.lisp (file)


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

5.1.2 Macros

Macro: aif TEST THEN &optional ELSE
Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: awhen TEST &rest BODY
Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: bind-class-slots CLASS INSTANCE &body BODY

Evaluates BODY with the slots from the CLASS bound to the values taken from INSTANCE. The CLASS must be a class object at compile-time, so the macro can extract the needed variable names for binding.

Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: decode-float-bits ()

Decodes the bits from an IEEE floating point number. Supported formats are listed in the variable LISP-BINARY/FLOAT::*FORMAT-TABLE*.

If the FORMAT is either :SINGLE or :DOUBLE, then the decoding is
done by storing the bits in memory and having the CPU reinterpret that buffer as a float. Otherwise, arithmetic methods are used to arrive at the correct value.

To prevent precision loss if you are decoding a larger type such as :QUADRUPLE or :OCTUPLE precision, use ’RATIONAL for the RESULT-TYPE to avoid a conversion to a smaller 32- or 64-bit float.

Package

lisp-binary/float

Source

float.lisp (file)

Macro: defbinary NAME (&rest DEFSTRUCT-OPTIONS &key BYTE-ORDER PRESERVE-*BYTE-ORDER* ALIGN EXPORT BYTE-COUNT-NAME &allow-other-keys) &rest FIELD-DESCRIPTIONS

Defines a struct that represents binary data, and also generates readers and writers.

Example:

(defbinary simple-binary (:export t
:byte-order :little-endian)
(magic 38284 :type (magic :actual-type (unsigned-byte 16)
:value 38284))
(size 0 :type (unsigned-byte 32))
(oddball-value 0 :type (unsigned-byte 32)
:byte-order :big-endian)
((b g r) 0 :type (bit-field :raw-type (unsigned-byte 8)
:member-types
((unsigned-byte 2)
(unsigned-byte 3)
(unsigned-byte 3))))
(name "" :type (counted-string 1 :external-format :utf8))
(alias #() :type (counted-buffer 4)
:byte-order :big-endian)
(floating-point 0.0d0 :type double-float)
(big-float 0 :type octuple-float)
(odd-float 0 :type (double-float :byte-order :big-endian))
(c-string "" :type (terminated-buffer 1 :terminator 0))
(nothing nil :type null) ;; Reads and writes nothing.
(other-struct nil :type other-binary
:reader #’read-other-binary
:writer #’write-other-binary)
(struct-array #() :type (counted-array 1 simple-binary))
(blah-type 0 :type (unsigned-byte 32))
(blah nil :type (eval (case oddball-value
((1) ’(unsigned-byte 32))
((2) ’(counted-string 2)))))
(an-array #() :type (simple-array (unsigned-byte 32) ((length c-string))))
(body #() :type (simple-array (unsigned-byte 8) (size))))

The above generates a DEFSTRUCT definition for SIMPLE-BINARY, along with
a definition for a READ-BINARY method and a WRITE-BINARY method.

The READ-BINARY method is EQL-specialized, and will construct the needed
object for you. It can be invoked like this:

(read-binary ’simple-binary stream)

The WRITE-BINARY method is called like this:

(write-binary object stream)

:BYTE-ORDER is either :little-endian or :big-endian to control the byte order that will
be used when reading, writing, or sending over a network. It is defined on a struct-wide
basis, and can be overridden on a per-slot basis.

:EXPORT determines whether the struct name, slot names, and generators will be exported
from the current package.

TYPES

DEFBINARY supports two kinds of types: Ordinary Common Lisp types, and Virtual Types.

Out of the Common Lisp types, DEFBINARY knows how to read:

(UNSIGNED-BYTE n) and (SIGNED-BYTE n), where N is the number of bits.
Since these types are used so frequently in DEFBINARY structs, there is a shorthand
for them: You can simply use the number of bits as the type. Positive for unsigned,
and negative for signed. Example:

(defbinary foobar ()
(x 0 :type 16) ;; 16-bit unsigned
(y 1 :type -16)) ;; 16-bit signed

float, short-float, half-float, single-float, double-float, quadruple-float,
and octuple-float.

FLOAT SINGLE-FLOAT are treated as IEEE Single Precision,
DOUBLE-FLOAT is treated as IEEE Double Precision, while the others are read
in as IEEE Half Precision, Quadruple Precision, etc.

HALF-FLOAT is stored in memory as a single-float, while floats larger than
Double Precision are decoded into RATIONAL numbers to preserve their
precision (they are encoded in their proper format on writing).

(SIMPLE-ARRAY element-type (size))

Example:

(defbinary foobar ()
(size 0 :type (unsigned-byte 16))
(arr #() :type (simple-array (unsigned-byte 8) (size))))

For the element type, any real or virtual type supported by DEFBINARY is allowed.
The SIZE is a Lisp expression that will be evaluated in an environment where all
previous members of the struct are bound to their names.

DEFBINARY will read and write all other CL objects using their READ-BINARY and
WRITE-BINARY methods, if defined.

The virtual types are:

(COUNTED-ARRAY count-size-in-bytes element-type &key bind-index-to)

This is a SIMPLE-ARRAY preceded by an integer specifying how many
elements are in it. The SIMPLE-ARRAY example above could be rewritten to use
a COUNTED-ARRAY instead, like this:

(defbinary foobar ()
(arr #() :type (counted-array 2 (unsigned-byte 8))))

Obscure fact: The COUNT-SIZE-IN-BYTES does not have to be an integer. It can also be a
fraction, which will trigger non-byte-aligned I/O. (example, if the size is 1/2, then the count
is 4 bits wide, and the first element begins halfway into the same byte as the count) The
ELEMENT-TYPE can also be non-byte-aligned. Doing this can result in needing to use a BIT-STREAM
to do I/O with the struct.

The same obscure fact applies anywhere the library accepts a size in bytes.

(COUNTED-STRING count-size-in-bytes &key (EXTERNAL-FORMAT :latin1))
(COUNTED-BUFFER count-size-in-bytes)

These are like COUNTED-ARRAYS, but their elements are one byte long. Furthermore, a
COUNTED-STRING will be encoded or decoded into a Lisp string according to its EXTERNAL-FORMAT.

The encoding/decoding is done using the FLEXI-STREAMS library, and valid EXTERNAL-FORMATs are those
that are accepted by FLEXI-STREAMS:OCTETS-TO-STRING.

Example:

(defbinary foobar ()
(str "" :type (counted-string 2 :external-format :utf8)))

(TERMINATED-STRING termination-length &key (terminator 0) (extenal-format :latin1))
(TERMINATED-BUFFER termination-length &key (terminator 0))

Specifies a C-style terminated string. The TERMINATOR is an integer that will be en/decoded
according to the field’s BYTE-ORDER. As such, it is capable of being more than one byte long,
so it can be used to specify multi-character terminators such as CRLF.

(FIXED-LENGTH-STRING length &key (external-format :latin1) (padding-character #Nul))

Specifies a string of fixed length. When writing, any excess space
in the string will be padded with the PADDING-CHARACTER. The LENGTH is the
number of bytes desired after encoding.

If the input string is longer than the provided LENGTH, a condition of type
LISP-BINARY:INPUT-STRING-TOO-LONG will be raised. Invoke the restart CL:TRUNCATE
to trim enough excess characters from the string to make it equal to the LENGTH.

(MAGIC &key actual-type value)

Specifies that a magic value will be read and written. The value will be
read as type ACTUAL-TYPE.

If the value read is not CL:EQUAL to the VALUE given, then a condition of type
BAD-MAGIC-VALUE will be raised.

A BAD-MAGIC-VALUE object contains the slots BAD-VALUE and REQUIRED-VALUE.

The error can be ignored by invoking the CL:CONTINUE restart.

BASE-POINTER

Instead of reading or writing this field, CL:FILE-POSITION will be called
on the current stream, and the address returned will be stored under a tag
with the same name as this slot. The tag can then be used to calculate
file positions and offsets. See the POINTER type for an example.

FILE-POSITION

Like BASE-POINTER, but no global tag is stored. The slot will contain the
address in the file of the next thing to be read. No actual reading or
writing is triggered by a slot of this type.

(REGION-TAG &key base-pointer-name)

Instead of writing the value of this slot, all POINTERs that have the same
REGION-TAG name as this slot will be written out here, and the corresponding
offsets will be updated. The file being written must be opened with
:DIRECTION :IO. The POINTERs themselves will be written as offsets from
whatever object has the BASE-POINTER named BASE-POINTER-NAME.

(POINTER &key pointer-type data-type base-pointer-name region-tag)

Specifies that the value is really a pointer to another value somewhere else
in the file. When reading, if a BASE-POINTER-NAME is supplied and a base-pointer
tag has been created, then the pointer will be treated as an offset from that
base-pointer. If no BASE-POINTER-NAME is provided, then the pointer is treated
as being an absolute file-position.

The :POINTER-TYPE key specifies the type of the pointer itself, and must be some kind
of integer.

The :DATA-TYPE specifies the data that is being pointed to.

The :REGION-TAG is used when writing. When WRITE-BINARY writes this field, what
it really does is just write a zero pointer (since the object being pointed to
proably occurs later in the file, so we don’t know what the address is going to
be yet). Then WRITE-BINARY stores the address OF THE POINTER, along with a
serialized representation of the data to be written.

When any WRITE-BINARY method gets to a REGION-TAG field, it writes out all the data
that has been stored under that tag’s name, and goes back to update the pointers.

POINTERs cannot be automatically written if they point to an earlier part of the file
than they themselves occur (no backwards-pointing pointers).

Because it must go back and change what it has previously written, the stream must
be opened with :DIRECTION :IO.

All I/O involving POINTERs, REGION-TAGs, or BASE-POINTERs should be performed
within a WITH-LOCAL-POINTER-RESOLVING-CONTEXT block.

Example:

(defbinary bar ()
(pointer-1 nil :type (pointer :pointer-type (unsigned-byte 16)
:data-type (terminated-string 1)
:base-pointer-name foo-base
:region-tag foo-region))
(pointer-2 0 :type (pointer :pointer-type (unsigned-byte 16)
:data-type quadruple-float
:base-pointer-name foo-base
:region-tag foo-region)))

(defbinary foo ()
(foo-base 0 :type base-pointer)
(bar nil :type bar)
;; POINTER-1 and POINTER-2 will point to this:
(foo-region nil :type (region-tag :base-pointer-name foo-base)))

(with-local-pointer-resolving-context
(let ((input (with-open-binary-file (in "foo.bin")
(read-binary ’foo in))))
(with-open-binary-file (out "bar.bin"
:direction :io)
(write-binary input stream))))

(BIT-FIELD &key raw-type member-types)

Specifies that multiple values are to be OR’d into a single integer for serialization
purposes. The name of a slot of this type must be specified as a list of names,
one for each value in the bit field. :RAW-TYPE specifies the type of the single integer
into which everything is being stored, and must meet the following requirements:

1. Be of the form (UNSIGNED-BYTE n)
2. Where N is divisible by 8.

The :MEMBER-TYPES is an unevaluated list of types that must consist entirely of
(UNSIGNED-BYTE b) or (SIGNED-BYTE b) types. The Bs must add up to N above.

READ-BINARY will automatically separate the values in the bit field into their
slots, and WRITE-BINARY will automatically OR them back together.

The default value you specify for this field should be given as a list
of default values for each of the subfields.

(CUSTOM &key reader writer (lisp-type t))

Specifies a slot of type LISP-TYPE that will be read by the provided
READER function and written with the provided WRITER function

The READER function must accept the lambda-list (STREAM), and its
argument will be the stream currently being read.

The WRITER function must accept the lambda-list (OBJECT STREAM), and
it is generally expected to write the OBJECT to the STREAM.

If these functions are specified as LAMBDA forms, then they will
be closures. The READER can expect every field that has been read
so far to be bound to their names, while the WRITER can expect
to be able to see all the slots in the struct being written.

Both functions are optional.

NULL

Reading and writing will be a no-op. The value of a field of type NULL will always read
as NIL and be ignored when writing.

RUNTIME TYPE DETERMINATION

(EVAL unquoted-type-expression)

The EVAL type specifier causes the type to be computed at runtime. The UNQUOTED-TYPE-EXPRESSION will be
evaluated just before attempting to read the field of this type in an environment where all the
previously-defined fields are bound to their names.

Example:

(defbinary foobar ()
(type-tag 0 :type (unsigned-byte 32))
(data nil :type (eval (case type-tag
(1 ’(unsigned-byte 16))
(2 ’(counted-string 1 :external-format :utf-8))))))

In the above example, READ-BINARY will first read the TYPE-TAG as an (UNSIGNED-BYTE 32),
then it will evaluate the CASE expression in order to get the type of the DATA. Then it
will generate a reader and a writer the same way DEFBINARY normally does, except at runtime
instead of compile time.

The CASE expression is not actually evaluated with a runtime call to EVAL. Instead, it is
embedded directly in the source code of the generated READ-BINARY and WRITE-BINARY methods.

The reader/writer code derived from the resulting type expression, however, *is* evaluated with
a runtime call to EVAL, and the part of the macroexpander that handles type fields gets called
at runtime as well.

If the UNQUOTED-TYPE-EXPRESSION evaluates to another EVAL type specifier, then that specifier
will be expanded once again.

DEFINING STRINGS

:EXTERNAL-FORMAT is any value accepted by flexi-streams:octets-to-string, such as :latin1 or :utf8.

String count and terminated-buffer terminator lengths are given in BYTES, unlike the
Common Lisp type ’(unsigned-byte n)’ in which the length is given in bits.

The types COUNTED-STRING and COUNTED-BUFFER are virtual types. When encountered, DEFBINARY will
generate code that deals with counted strings and buffers, which are blocks of data that begin
with a size. The number passed with this type is the size of the count. The difference between the
two is that one of them is converted to and from a STRING while the other retains its raw binary
representation and will be a SIMPLE-ARRAY of (UNSIGNED-BYTE 8).

(TERMINATED-STRING terminator-size) and (TERMINATED-BUFFER terminator-size) are for blocks of data that end with a
terminator of some kind. The terminator is not produced as part of the buffer. The terminator-size defaults to 1.

All generated buffers and strings are guaranteed to have the type SIMPLE-ARRAY.

ARRAYS OF COMPLEX TYPES

In the (SIMPLE-ARRAY element-type length) type specifier, the LENGTH is evaluated when the array is being read.
Previously defined fields will be bound. The ELEMENT-TYPE can be any type supported by DEFBINARY, including
the EVAL type specifier and the COUNTED-STRING, COUNTED-BUFFER, TERMINATED-STRING, and TERMINATED-BUFFER virtual
types. Notably, ELEMENT-TYPE can be other types that were previously defined with DEFBINARY.

There is also the type (COUNTED-ARRAY count-size element-type), which functions like COUNTED-STRING or COUNTED-BUFFER,
except that each element of the array can be a complex type.

NON-BYTE-ALIGNED I/O: AN ALTERNATIVE TO BIT FIELDS

DEFBINARY supports non-byte-aligned reads. For example, if you want to read a 4-bit
unsigned integer and a 12-bit signed integer:

(defbinary non-conforming (:byte-order :big-endian)
(x 0 :type 4)
(y 0 :type 12)) ;; Total: 16 bits.

The above will compile to a single 16-bit read, and the two values will be automatically
extracted into their respective fields. The reverse operation is generated for writing.

In fact, the above is converted into a BIT-FIELD declaration, so it is exactly equivalent
to the following:

(defbinary non-conforming-bit-field-version (:byte-order :big-endian)
((x y) 0 :type (bit-field :raw-type (unsigned-byte 16)
:member-types ((unsigned-byte 4)
(unsigned-byte 12)))))

The macro will group sets signed or unsigned bytes to achieve a read that consists of
whole bytes. This grouping mechanism only works for SIGNED-BYTE and UNSIGNED-BYTE integers.

For other types, DEFBINARY will generate a temporary BIT-STREAM for the non-byte-aligned parts:

(defbinary non-byte-aligned-string (:byte-order :big-endian)
(x 0 :type 4)
(string "" :type (counted-string 1))
(y 0 :type 4))
;; End of non-byte-aligned part
(z "" :type (counted-string 1)))

As long as the sum of the bits adds up to a whole number of bytes, no
special handling is required on the part of the programmer. Internally,
the above generates a temporary bit-stream and reads from it, and it discards
the bit-stream before reading Z, because Z doesn’t require non-byte-aligned I/O.
This is slower than doing whole-byte reads.

Finally, you can specify bytes that throw off the byte-alignment of the
stream:

(defbinary stays-non-byte-aligned ()
(x 0 :type 3))

If the macro cannot group the fields in the struct into byte-aligned reads,
then the struct can only be read from a BIT-STREAM and not a normal
stream (see WRAP-IN-BIT-STREAM and WITH-WRAPPED-IN-BIT-STREAM). In this
case, the macro will generate READ-BINARY and WRITE-BINARY methods that
are specialized to a second argument of type BIT-STREAM.

BIT-STREAMs can wrap any type of stream, including other BIT-STREAMs. This
means that you can nest one struct that does BIT-STREAM I/O inside another:

(defbinary stays-non-byte-aligned ()
(x 0 :type 3)
(y nil :type non-byte-aligned-string)) ;; See above

NON-BYTE-ALIGNED FIELDS and LITTLE ENDIANNESS

Bit fields are inherently confusing when they are applied to little-endian data (unlike
big-endian data, where they make perfect sense). This is because programmers who write
specifications for little-endian formats sometimes still describe the bit fields by
starting with the most significant bit.

Also, code that handles bit fields from little endian data may also handle that data
starting with the most significant bit (including some byte-order-independent code in
this library).

The BIT-FIELD type in DEFBINARY adds to this confusion, since the fields must always
be given starting with the most significant bit, regardless of the format’s byte order.

However, when specifying non-byte-aligned fields without using BIT-FIELDs, they must be
specified starting with the LEAST significant bit in a LITTLE-ENDIAN format, but they
must be specified starting with the MOST significant bit in a BIG-ENDIAN format. For
example, consider the following toy format:

(defbinary toy-format (:byte-order :little-endian)
(a 0 :type 4)
(b 0 :type 16)
(c 0 :type 4))

Write it to disk with the following code:

(with-open-binary-file (out #P"/tmp/test-1.bin" :direction :output
:if-exists :supersede
:if-does-not-exist :create)
(write-binary (make-toy-format :a #x1 :b #x2345 :c #x6) out))

The resulting file would produce the following confusing hex dump:

51 34 62

What is that 5 from the middle doing at the very beginning?!?! Since 0x5 is
the second-least-significant nibble in the structure, it appears in the
most significant nibble of the least significant byte.

Reading the above as a little-endian, 24-bit unsigned integer gives the
integer #x623451, which is what you should have been expecting, since
C is the most significant field, and its value is 6.

You can also specify the above format using the BIT-FIELD type. But then you
have to account for the fact that in a BIT-FIELD type description, you always
describe the most significant bits first, no matter what. So the variables
and their corresponding types have to be reversed:

(defbinary toy-format/bit-field (:byte-order :little-endian)
((c b a) nil :type (bit-field :raw-type (unsigned-byte 24)
:member-types ((unsigned-byte 4)
(unsigned-byte 16)
(unsigned-byte 4)))))

ALIGNMENT

DEFBINARY can generate aligned structures. Alignment is calculated as an offset from the beginning of the structure
being defined. If a SIMPLE-ARRAY is defined with :ALIGN-ELEMENT {boundary}, then each element will be aligned to that
boundary. On writes, the alignment is achieved by writing NUL (0) bytes. On reads, the alignment is performed by
reading bytes from the stream one at a time. Alignment is always performed before reading and writing, never after.

MANUAL ALIGNMENT

If the &KEY argument :BYTE-COUNT-NAME is specified, then the name given will be bound as a variable whose value is the number of bytes read or written so far. This binding is visible in forms that are evaluated at runtime, such as array-length specifiers and EVAL type specifiers.

FLOATING-POINT NUMBERS

DEFBINARY can read IEEE floats ranging from half-precision up to octuple precision. Double-precision and below are
represented in memory by hardware floats, while larger-precision floats are decoded into RATIONALs.

Furthermore, single and double-precision floats are decoded from their byte representation by using CFFI, which
lets the hardware do the work on those systems that have FPUs (such as x86/AMD machines).

All other types of floating-point number are encoded and decoded using arithmetic.

Package

lisp-binary

Source

binary-2.lisp (file)

Macro: define-enum NAME SIZE (&key SIGNED BYTE-ORDER) &rest VALUES

Define an enum type. What this does is allow LISP-BINARY to automatically map between keywords and integer values that are expected to be found in a binary file. The SIZE is in bytes.

Example:

(define-enum speeds 2 ()
slow ;; Implicitly 0
light-speed ;; Implicitly 1
(ridiculous-speed 5) ;; Explicit value
ludicrous-speed) ;; Implicitly 6

Package

lisp-binary

Source

binary-1.lisp (file)

Macro: destructuring-case EXPRESSION &rest CASES

Matches the EXPRESSION against one of the CASES. Each CASE is of
the form (lambda-list &key where &body body) and can have a guard clause.

The first pattern that successfully DESTRUCTURING-BINDs against the EXPRESSION without an error *and* satisfies the optional :WHERE expression is the one that will be selected. OTHERWISE is supported and works just as in the CL:CASE form.

Example:

(destructuring-case ’(1 2 3)
((a b c) :where (symbolp a)
(declare (ignore b c))
(list :symbol a))
((a b &optional c) :where (number b)
(declare (ignore a c)))
(list :number b))
((a &rest b)
(declare (ignore b))
(list :whatever a))
(otherwise
:nothing-matched))

The DECLARE form is processed before the :WHERE clause even though it appears after it.

Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: encode-float-bits ()
Package

lisp-binary/float

Source

float.lisp (file)

Macro: let-values* BINDINGS &body BODY

Optimized implementation of LET-VALUES*. You can bind a multiple-value expression to
a list of variables, or you can bind a single value. Generates as few nested MULTIPLE-VALUE-BIND and LET* forms as possible.

Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: letf PLACE-BINDINGS &body BODY

Temporarily rebind places like you would special variables. Before control enters the BODY, the PLACE-BINDINGS are altered using SETF, and after exiting the BODY, their values are restored to their original values with SETF.

Similar to CL-LETF in Emacs.

Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: named-let NAME DEFS &body BODY
Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: pop-bits N-BITS INTEGER-SIZE INTEGER-PLACE

Pops the N most significant bits off the front of the INTEGER-PLACE and returns it. INTEGER-SIZE is the number of unpopped bits in the integer.

Package

lisp-binary/integer

Source

integer.lisp (file)

Macro: pop-bits/le N-BITS INTEGER-PLACE

Pops the N LEAST significant bits off the front of the INTEGER-PLACE and returns it. INTEGER-SIZE is the number of bits in the integer.

Package

lisp-binary/integer

Source

integer.lisp (file)

Macro: push-bits N INTEGER-SIZE INTEGER-PLACE

Pushes N onto the front of INTEGER-PLACE,
the ’front’ being defined as the MOST significant bits. The INTEGER-SIZE specifies how many bits are already in the INTEGER-PLACE.

Package

lisp-binary/integer

Source

integer.lisp (file)

Macro: push-bits/le N N-BITS INTEGER-PLACE

Pushes N-BITS bits from N onto the front of INTEGER-PLACE, the ’front’ being defined as the LEAST significant bits. The INTEGER-SIZE specifies how many bits are already in the INTEGER-PLACE.

Package

lisp-binary/integer

Source

integer.lisp (file)

Macro: pushover OBJ* PLACE &key KEY TEST

Pushes the OBJ* into the PLACE. If an "identical" object is already there, it is overwritten. Whether something in the PLACE is considered "identical" can be controlled with the :TEST and :KEY keywords.

Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: read-float ()
Package

lisp-binary/float

Source

float.lisp (file)

Macro: simple-define-condition NAME PARENT-CLASSES SLOTS
Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: struct-like-defclass NAME SUPERCLASSES &rest SLOT-DEFS

An extremely simplified version of DEFCLASS. Written because I needed to be able to list the slots of a certain struct.

Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: with-buffered-output (VAR STREAM) &body BODY

Creates buffered output stream VAR. Data written to VAR will be written to STREAM after the BODY returns. This makes it possible to write binaries that require streams opened in :DIRECTION :IO to streams that are open in :DIRECTION :OUT

Package

lisp-binary

Source

binary-1.lisp (file)

Macro: with-file-position (POSITION STREAM) &body BODY
Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: with-local-pointer-resolving-context &body BODY

Deal with POINTERs in a thread-safe manner. Generated READ-BINARY and WRITE-BINARY methods rely on special variables to store information to make sure that offsets are calculated correctly. This macro creates local bindings of all the relevant special variables.

Package

lisp-binary

Source

binary-1.lisp (file)

Macro: with-open-binary-file (STREAM FILESPEC &rest OPTIONS &key DIRECTION IF-EXISTS IF-DOES-NOT-EXIST) &body BODY

Like WITH-OPEN-FILE, but always opens the file as a binary file.

Package

lisp-binary

Source

binary-1.lisp (file)

Macro: with-wrapped-in-bit-stream (VAR NON-BITSTREAM &key BYTE-ORDER CLOSE-WHEN-DONE) &body BODY
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Macro: with-wrapped-in-reverse-stream (VAR NON-BITSTREAM &key CLOSE-WHEN-DONE) &body BODY
Package

reverse-stream

Source

reverse-stream.lisp (file)

Macro: write-float ()
Package

lisp-binary/float

Source

float.lisp (file)


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

5.1.3 Functions

Function: assoc-cdr ITEM ASSOC-LIST &key TEST
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: buffer &rest ELEMENTS
Package

lisp-binary

Source

binary-1.lisp (file)

Function: byte-aligned-p BIT-STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: decode-ip-addr RAW-MSB
Package

lisp-binary

Source

binary-1.lisp (file)

Function: decode-lsb BYTES
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: decode-msb BYTES
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: divisiblep NUM DENOM
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: encode-lsb NUMBER BYTES
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: encode-msb NUMBER BYTES
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: find-sublist SUBLIST LIST

Finds any part of LIST is equal to SUBLIST and returns it, otherwise returns NIL

Package

lisp-binary-utils

Source

utils.lisp (file)

Function: get-lsb-byte NUMBER BYTE
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: group LIST &key TEST KEY
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: infinityp ()

Returns two values:
T if the DECODED-VALUE represents a floating-point infinity
T if the DECODED-VALUE represents positive infinity, or NIL if it’s negative infinity.

Some Lisp implementations support real floating-point infinities, but the ANSI standard does
not require it, and some Lisp implementations don’t bother to support them. On those implementations, infinities are represented by the keywords :+INF and :-INF. To detect positive/negative infinity portably, use this function.

Package

lisp-binary/float

Source

float.lisp (file)

Function: insert-before BEFORE-ITEM NEW-ITEM LIST &key TEST KEY
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: join-field-bits FIELD-BITS FIELD-SIGNEDNESS FIELD-VALUES
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: mapseq FUNCTION SEQUENCE
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: nanp ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: open-binary PATHNAME &key DIRECTION IF-EXISTS IF-DOES-NOT-EXIST

Like OPEN, but always opens a binary stream suitable for use with the DEFBINARY library.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: plist-replace PLIST INDICATOR NEW-VALUE
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: read-binary-type TYPE STREAM &key BYTE-ORDER ALIGN ELEMENT-ALIGN

Read a value of type TYPE from the STREAM. TYPE is any type supported by the DEFBINARY macro.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: read-bits BITS STREAM

Reads BITS bits from STREAM. If the STREAM is big-endian, the most significant BITS bits will be read, otherwise, the least significant BITS bits will be. The result is an integer of BITS bits.

Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: read-bytes-with-partial STREAM BITS

Reads BITS bits from the STREAM, where BITS is expected to be more than a byte’s worth
of bits. Returns three values:

1. A buffer containing as many whole bytes as possible. This buffer
is always read first, regardless of whether the bitstream is byte-aligned.
2. The partial byte.
3. The number of bits that were read for the partial byte.

The byte order is determined from the STREAM object, which must be a SIMPLE-BIT-STREAM:BIT-STREAM.

Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: read-counted-string SIZE-LEN STREAM &key BYTE-ORDER

Reads an unsigned integer of SIZE-LEN bytes in the specified BYTE-ORDER, then reads a byte vector of SIZE-LEN bytes. Returns two values:

1. The byte vector
2. The total number of bytes that were read.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: read-enum ENUM STREAM
Package

lisp-binary

Source

binary-1.lisp (file)

Function: read-file FILENAME &key ELEMENT-TYPE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: read-integer LENGTH STREAM &key BYTE-ORDER SIGNED

Reads an integer of LENGTH bytes from the STREAM in the specified BYTE-ORDER.

If SIGNED is non-NIL, the number is interpreted as being in two’s complement format.

If the STREAM is a BIT-STREAM, then the LENGTH doesn’t have to be an integer.

Package

lisp-binary/integer

Source

integer.lisp (file)

Function: read-terminated-string STREAM &key TERMINATOR

Reads a string ending in the byte sequence specified by TERMINATOR. The TERMINATOR is not included in the resulting buffer. The default is to read C-style strings, terminated by a zero.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: recursive-find ITEM TREE &key TEST
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: recursive-find-if PRED TREE
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: recursive-find-sublist SUBLIST TREE
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: recursive-find/collect PRED TREE
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: recursive-map FUNCTION TREE
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: recursive-mapcar FUNCTION TREE &optional TRAVERSE-RESULTS RESULT

Maps the FUNCTION onto every node in the TREE. Works correctly with improper lists.

If TRAVERSE-RESULTS is non-NIL, then RECURSIVE-MAPCAR will traverse the result of the FUNCTION even if it is not EQ to the original value.

Package

lisp-binary-utils

Source

utils.lisp (file)

Function: relative-file-position STREAM OFFSET
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: remove-binding VAR FORM

Removes any binding for VAR from all LET, LET*, LET-VALUES, or LET-VALUES* forms found in the FORM.

Package

lisp-binary-utils

Source

utils.lisp (file)

Function: remove-plist-keys PLIST &rest KEYS
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: signed->unsigned N BYTES
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: signed->unsigned/bits N BITS
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: split-bit-field INTEGER FIELD-BITS &optional FIELD-SIGNEDNESS

Given the INTEGER, split it up as a bit field. The sizes and number of elements are given by the FIELD-BITS parameter. If FIELD-SIGNEDNESS is specified, then it must be a list that contains NIL for each element that will be interpreted as an unsigned integer, and non-NIL for signed integers.

Example:

CL-USER> (split-bit-field #xffaaff ’(8 8 8))
255
170
255
CL-USER>

Better performance could be acheived if INTEGER could be a FIXNUM, but it can’t.

Package

lisp-binary/integer

Source

integer.lisp (file)

Function: subst* BINDINGS FORM &key TEST
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: unsigned->signed N BYTES
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: unsigned->signed/bits N BITS
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: write-binary-type VALUE TYPE STREAM &key BYTE-ORDER ALIGN ELEMENT-ALIGN

Write the VALUE, interpreting it as type TYPE, to the STREAM. The TYPE is any type supported by the DEFBINARY macro.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: write-bits N N-BITS STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: write-counted-string SIZE-LEN STREAM BUFFER &key BYTE-ORDER

Writes the length of the BUFFER on the STREAM as an unsigned integer of SIZE-LEN bytes in the specified BYTE-ORDER, then writes out the BUFFER.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: write-enum ENUM SYMBOL STREAM
Package

lisp-binary

Source

binary-1.lisp (file)

Function: write-integer NUMBER SIZE STREAM &key BYTE-ORDER SIGNED
Package

lisp-binary/integer

Source

integer.lisp (file)

Function: write-terminated-string STRING STREAM &key TERMINATOR
Package

lisp-binary

Source

binary-1.lisp (file)


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

5.1.4 Generic functions

Generic Function: read-binary TYPE STREAM
Package

lisp-binary

Source

binary-1.lisp (file)

Methods
Method: read-binary (TYPE (eql terminated-string)) STREAM
Generic Function: read-bytes N STREAM &key ELEMENT-TYPE

Read N bytes of type ELEMENT-TYPE from STREAM and return them in a newly-allocated array.

Returns two values: The array containing the bytes, and the number of bytes read.

For some types of stream, it is legal to use a fractional number for N. In that case,
the whole bytes are read first, and then the leftover bits. The leftover bits are given
their own byte at the end of the returned array. The second return value (# of bytes read)
will also be fractional in this case. The fractional part can be used to calculate
how many bits the partial byte represents.

If you’re using 8-bit bytes and want to read 11 bits (a whole byte plus three bits), give
11/8 as the value of N.

NOTE: If you’re using this with a bit-stream created with WRAP-IN-BIT-STREAM, the :BYTE-ORDER given to that function should match the one given to this function.

Package

lisp-binary/integer

Source

integer.lisp (file)

Methods
Method: read-bytes N (STREAM bit-stream) &key ELEMENT-TYPE
Source

binary-1.lisp (file)

Method: read-bytes N STREAM &key ELEMENT-TYPE
Generic Function: wrap-in-bit-stream OBJECT &key BYTE-ORDER

Creates a BIT-STREAM that can read one bit at a time from the OBJECT. The BIT-STREAM can be discarded if BYTE-ALIGNED-P returns T.

Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Methods
Method: wrap-in-bit-stream (OBJECT stream) &key BYTE-ORDER
Generic Function: wrap-in-reverse-stream OBJECT

Creates a REVERSE-STREAM that can read one bit at a time from the OBJECT. The REVERSE-STREAM can be discarded if BYTE-ALIGNED-P returns T.

Package

reverse-stream

Source

reverse-stream.lisp (file)

Methods
Method: wrap-in-reverse-stream (OBJECT stream)
Generic Function: write-binary OBJ STREAM
Package

lisp-binary

Source

binary-1.lisp (file)

Generic Function: write-bytes BUFFER STREAM &optional BYTES

Write BYTES bytes of the BUFFER into the STREAM. If
BYTES is not provided, then the whole BUFFER is written.

For some types of stream, it is legal to use a fractional number for BYTES. In that case, the whole bytes are written first, and then the leftover bits. The leftover bits must be given their own byte at the end of the BUFFER. WRITE-BYTES assumes that all bytes are 8 bits long, so to write 4 bits, you would give 1/2 as the value of BYTES.

NOTE: If you’re using this with a bit-stream created with WRAP-IN-BIT-STREAM, the :BYTE-ORDER given to that function should match the one given to this function.

Package

lisp-binary/integer

Source

integer.lisp (file)

Methods
Method: write-bytes BUFFER (STREAM bit-stream) &optional BYTES
Source

binary-1.lisp (file)

Method: write-bytes BUFFER STREAM &optional BYTES

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

5.1.5 Conditions

Condition: bad-enum-value ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

simple-error (condition)

Direct slots
Slot: integer-value
Initargs

:integer-value

Slot: symbol-value
Initargs

:symbol-value

Slot: enum-name
Initargs

:enum-name

Condition: bad-magic-value ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

simple-error (condition)

Direct slots
Slot: bad-value
Initargs

:bad-value

Slot: required-value
Initargs

:required-value

Condition: input-string-too-long ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

simple-error (condition)

Direct slots
Slot: input-string
Initargs

:input-string


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

5.1.6 Classes

Class: bit-stream ()
Package

lisp-binary/integer

Source

simple-bit-stream.lisp (file)

Direct superclasses

fundamental-binary-stream (class)

Direct methods
  • write-bytes (method)
  • read-bytes (method)
  • stream-file-position (method)
  • stream-read-sequence (method)
  • stream-write-sequence (method)
  • stream-write-byte (method)
  • stream-read-byte (method)
  • close (method)
  • stream-force-output (method)
  • stream-finish-output (method)
Direct slots
Slot: element-bits
Type

fixnum

Initargs

:element-bits

Initform

8

Slot: real-stream
Type

stream

Initargs

:real-stream

Slot: last-byte
Type

(or unsigned-byte null)

Initform

0

Slot: last-op
Type

symbol

Slot: bits-left
Type

integer

Initform

0

Slot: byte-order
Type

keyword

Initargs

:byte-order

Initform

:little-endian

Class: pointer ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: offset
Type

integer

Initargs

:offset

Initform

0

Readers

pointer-offset (generic function)

Writers

(setf pointer-offset) (generic function)

Slot: type
Type

symbol

Initargs

:type

Readers

pointer-type (generic function)

Writers

(setf pointer-type) (generic function)

Slot: base-pointer
Type

keyword

Initargs

:base-pointer

Initform

:beginning

Readers

pointer-base-pointer (generic function)

Writers

(setf pointer-base-pointer) (generic function)

Slot: stream
Type

keyword

Initargs

:stream

Initform

*standard-input*

Readers

pointer-stream (generic function)

Writers

(setf pointer-stream) (generic function)

Class: reverse-stream ()
Package

reverse-stream

Source

reverse-stream.lisp (file)

Direct superclasses

fundamental-binary-stream (class)

Direct methods
  • stream-file-position (method)
  • stream-read-sequence (method)
  • stream-write-sequence (method)
  • stream-write-byte (method)
  • stream-read-byte (method)
  • close (method)
  • stream-force-output (method)
  • stream-finish-output (method)
Direct slots
Slot: element-bits
Type

fixnum

Initargs

:element-bits

Initform

8

Slot: lookup-table
Initargs

:lookup-table

Slot: real-stream
Type

stream

Initargs

:real-stream


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *8-bit-lookup-table*
Package

reverse-stream

Source

reverse-stream.lisp (file)

Special Variable: *always-produce-byte-count*

These functions are known to always produce a byte count, so DEFBINARY doesn’t have to generate code to verify that they did.

Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *base-pointer-tags*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *debug*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *denormals*
Package

lisp-binary/float

Source

float.lisp (file)

Special Variable: *enum-definitions*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *format-table*
Package

lisp-binary/float

Source

float.lisp (file)

Special Variable: *ignore-eval-type-bitstream-issue*

If a DEFBINARY struct contains a field of type (EVAL ...),
then the macro cannot statically determine whether the struct can
be read without using a BIT-STREAM. If this is set to NIL, then
a condition is raised every time an (EVAL ...) type is encountered,
with restarts available to tell the macro whether a bitstream is
required for that particular field.

Typically, the error would reach EMACS, and the programmer can then
pick a restart from the menu.

However, this doesn’t work if you’re using COMPILE-FILE, because COMPILE-FILE
catches exceptions, so you don’t see the error until it has already been
caught, so you will not be presented with the restarts that I have set up.

For most programs, just ignoring the issue is good enough. Setting this to T (the default) causes the expander to ignore this problem and not raise a condition.

Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *ignore-on-write*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *known-defbinary-types*

An alist whose keys are the names of DEFBINARY structs and whose values are the field-descriptions of those structs. Needed by TYPE-SIZE

Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *last-f*
Package

lisp-binary

Source

binary-2.lisp (file)

Special Variable: *outer-stream-file-position*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *queued-pointers*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *type-info-objects*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: *virtual-types*
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: debug-data
Package

lisp-binary

Source

binary-1.lisp (file)

Special Variable: defbinary-type
Package

lisp-binary

Source

binary-1.lisp (file)


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

5.2.2 Macros

Macro: acond &rest CASES
Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: define-virtual-type NAME LAMBDA-LIST READER WRITER LISP-TYPE &key ESTIMATED-TOTAL-BITS STREAM-REQUIRED CAN-BE-IN-BIT-FIELD

Define a new Virtual Type.

A Virtual Type is a rule that tells the LISP-BINARY how to read a particular kind of
value from a stream, and how to write it back. The result of reading a Virtually-Typed object
can be an object of any Lisp type. Which Lisp type the Virtual Type corresponds to must
be specified in the LISP-TYPE argument.

The same LISP-TYPE can be produced by many different Virtual Types. As a result, the LISP-BINARY library must always be told which type it is reading or writing. This is usually done at compile-time through the DEFBINARY macro.

The READER and WRITER must be functions.

The READER accepts a STREAM argument and returns two values:

1. The fully-processed value that was read.
2. The number of bytes that were read from the STREAM. If the STREAM is a BIT-STREAM,
then the number of bytes can be fractional, to indicate how much was read down to
the bit. 1/8 of a byte = 1 bit.

The WRITER accepts the lambda list (OBJ STREAM), where OBJ is the value to be written. It
returns the number of bytes that were written.

Package

lisp-binary

Source

binary-1.lisp (file)

Macro: encode-float-bits/arithmetic-macro ()
Package

lisp-binary/float

Source

float.lisp (file)

Macro: let-values/stupid* BINDINGS &body BODY

A naive implementation of LET-VALUES*. Each binding must bind a multiple-value expression to a list of variables, and will expand to a nested MULTIPLE-VALUE-BIND expression.

Package

lisp-binary-utils

Source

utils.lisp (file)

Macro: make-reader-let-def F
Package

lisp-binary

Source

binary-2.lisp (file)

Macro: old-make-reader-let-def F

Creates a single variable definition to go in the let-def form within READ-BINARY. F is a BINARY-FIELD object that describes the field. Captures several local variables within DEFBINARY. It’s a macro because it became necessary to use it twice.

Package

lisp-binary

Source

binary-2.lisp (file)

Macro: popbit ()
Package

lisp-binary/float

Source

float.lisp (file)

Macro: read-bytes-with-partial/macro STREAM* BITS BYTE-ORDER &key ADJUSTABLE
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Macro: read-octets-to-string READ-FORM &rest OPTIONS
Package

lisp-binary

Source

binary-1.lisp (file)

Macro: read/write-binary-type READ-OR-WRITE TYPE STREAM &key VALUE BYTE-ORDER ALIGN ELEMENT-ALIGN
Package

lisp-binary

Source

binary-1.lisp (file)

Macro: with-letf-bindings (TEMP-VAR PLACE-VAR VALUE-VAR TEMP-BINDING PLACE-BINDING) &body BODY
Package

lisp-binary-utils

Source

utils.lisp (file)


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

5.2.3 Functions

Function: %infinityp ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: %make-infinity ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: %make-quiet-nan ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: %make-reader-let-def F FORM-VALUE MOST-RECENT-BYTE-COUNT PREVIOUS-DEFS PREVIOUS-DEFS-PUSH PREVIOUS-DEFS-SYMBOL BYTE-COUNT-NAME BYTE-ORDER

Creates a single variable definition to go in the let-def form within READ-BINARY. F is a BINARY-FIELD object that describes the field.

Package

lisp-binary

Source

binary-2.lisp (file)

Function: %make-signalling-nan ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: %qnanp ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: %read-float ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: %snanp ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: %stream-read-sequence STREAM SEQUENCE START END
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: %stream-read-sequence STREAM SEQUENCE START END
Package

reverse-stream

Source

reverse-stream.lisp (file)

Function: %stream-write-sequence STREAM SEQUENCE START END
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: %stream-write-sequence STREAM SEQUENCE START END
Package

reverse-stream

Source

reverse-stream.lisp (file)

Function: %write-float ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: add-base-pointer-tag TAG POINTER
Package

lisp-binary

Source

binary-1.lisp (file)

Function: add-bit-stream-id FIELD-DESCRIPTIONS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: add-bit-stream-vars BIT-STREAM-GROUPS STREAM-SYMBOL BYTE-ORDER MAKE-LET-DEF LET-DEFS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: add-default-value-if-needed DEF
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: add-stream-definitions BIT-STREAM-GROUPS STREAM-SYMBOL BYTE-ORDER LET-DEFS

If the LET-DEFS contain fields that must be read from a bit-stream, this function
adds the necessary BIT-STREAM type variables to them. BIT-STREAM-GROUPS is a hash table that maps each bit-stream variable name to the BINARY-FIELD objects of the variables that must be read from that bit-stream. The STREAM-SYMBOL is the name of the default stream, and BYTE-ORDER is the :BYTE-ORDER option passed to the DEFBINARY macro (only :BIG-ENDIAN and :LITTLE-ENDIAN are supported. Handling for :DYNAMIC byte order must happen elsewhere).

Package

lisp-binary

Source

binary-2.lisp (file)

Function: align-to-boundary BYTE-COUNT BOUNDARY MOVE-OP STREAM
Package

lisp-binary

Source

binary-1.lisp (file)

Function: array-pop ARR
Package

lisp-binary

Source

binary-1.lisp (file)

Function: binary-field-bit-stream-id INSTANCE
Function: (setf binary-field-bit-stream-id) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: binary-field-defstruct-field INSTANCE
Function: (setf binary-field-defstruct-field) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: binary-field-name INSTANCE
Function: (setf binary-field-name) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: binary-field-p OBJECT
Package

lisp-binary

Source

binary-1.lisp (file)

Function: binary-field-read-form INSTANCE
Function: (setf binary-field-read-form) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: binary-field-type INSTANCE
Function: (setf binary-field-type) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: binary-field-write-form INSTANCE
Function: (setf binary-field-write-form) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: bit-field-type-p TYPE
Package

lisp-binary

Source

binary-2.lisp (file)

Function: bitfield-spec->defstruct-specs NAME DEFAULT-VALUES OPTIONS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: build-virtual-type-reader/writer-expander EXPRESSION-FORM VALUE-NAME STREAM-SYMBOL
Package

lisp-binary

Source

binary-1.lisp (file)

Function: calculate-exponent ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: calculate-significand ()

Given a FRACTION and number of SIGNIFICAND-BITS, calculates the integer significand. The significand returned includes the implicit bit, which must be removed in the final floating-point encoding.

Package

lisp-binary/float

Source

float.lisp (file)

Function: clear-tag TAG
Package

lisp-binary

Source

binary-1.lisp (file)

Function: combine-field-descriptions FIELD-DESCRIPTIONS

Group the FIELD-DESCRIPTIONS according to how they should be grouped into bit-fields.

Returns two values:

1. A list of fields very similar to the FIELD-DESCRIPTIONS, except that some elements of the list will be replaced by lists of fields that should be grouped together. Since a single field description is itself a list, use LIST-OF-FIELDS-P to tell the difference between one field and a list of fields.

2. Either :BIT-STREAM-REQUIRED if the whole struct can only be read with a bit-stream, or no second value otherwise.

Package

lisp-binary

Source

binary-2.lisp (file)

Function: compute-reversed-byte N BITS
Package

reverse-stream

Source

reverse-stream.lisp (file)

Function: convert-to-bit-fields FIELD-DESCRIPTIONS

Converts groups of non-byte-aligning field descriptions into bitfields where possible. If they can’t be read as bitfields, then a :BIT-STREAM-ID option is added to the field.

Package

lisp-binary

Source

binary-2.lisp (file)

Function: copy-binary-field INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: copy-enum-definition INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: copy-out-pointer INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: copy-virtual-type INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: decode-float-bits/arithmetic ()

Decodes IEEE floating-point from an integer bit-pattern.

Package

lisp-binary/float

Source

float.lisp (file)

Function: decode-float-bits/cffi ()

Decodes the bits from a read-in floating-point number using the hardware. Assumes that only :SINGLE and :DOUBLE work.

Package

lisp-binary/float

Source

float.lisp (file)

Function: decode-significand ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: defbinary-constructor-name NAME DEFSTRUCT-OPTIONS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: denormalp ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: denormalp/arithmetic ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: dump-tag TAG BASE-POINTER STREAM &optional PREVIOUS-RESULT
Package

lisp-binary

Source

binary-1.lisp (file)

Function: encode-float-bits/arithmetic ()

Calculate the bits of a floating-point number using plain arithmetic, given the FRACTION and the format information SIGNIFICAND-BITS, EXPONENT-BITS, and EXPONENT-BIAS. The returned value is an integer.

Package

lisp-binary/float

Source

float.lisp (file)

Function: encode-float-bits/cffi ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: encode-float-bits/runtime-format ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: encode-significand ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: enum-definition-byte-order INSTANCE
Function: (setf enum-definition-byte-order) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: enum-definition-name INSTANCE
Function: (setf enum-definition-name) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: enum-definition-p OBJECT
Package

lisp-binary

Source

binary-1.lisp (file)

Function: enum-definition-signed INSTANCE
Function: (setf enum-definition-signed) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: enum-definition-size INSTANCE
Function: (setf enum-definition-size) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: enum-definition-variables INSTANCE
Function: (setf enum-definition-variables) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: enump SYMBOL
Package

lisp-binary

Source

binary-1.lisp (file)

Function: expand-byte-shorthand N
Package

lisp-binary

Source

binary-2.lisp (file)

Function: expand-defbinary-field STRUCT-NAME NAME DEFAULT-VALUE &rest OTHER-KEYS &key TYPE BYTE-ORDER BYTE-COUNT-NAME ALIGN ELEMENT-ALIGN BIT-STREAM-ID READER WRITER STREAM-SYMBOL PREVIOUS-DEFS-SYMBOL BIND-INDEX-TO &allow-other-keys

Expands the field into three values: A slot-descriptor suitable for CL:DEFSTRUCT, a form that reads this slot from a stream, and a form that writes it to a stream. The reader and writer must be evaluated in a context where the NAME is bound to the slot’s value.

Package

lisp-binary

Source

binary-2.lisp (file)

Function: expand-defbinary-type-field STRUCT-NAME TYPE-INFO

Expands the :TYPE field of a DEFBINARY form. Returns three values:
1. A :TYPE specifier that can be spliced into a slot definition in a DEFSTRUCT form.

2. A READER-FORM that can be spliced into another function to read a datum of the specified
type. The READER-FORM will assume that it will be spliced into a scope where there’s
a readable stream. The name of this stream must be stored in (SLOT-VALUE TYPE-INFO ’STREAM-SYMBOL).

3. A WRITER-FORM to write such a datum. It can be spliced into a scope similar to that of the READER-FORM.

TYPE-INFO is a DEFBINARY-TYPE that contains the following:

NAME - The name of the variable to be defined. The WRITER-FORM will be evaluated in a context
where the NAME is bound to the object being written.
TYPE - The type specifier. Its value may specify a virtual type, such as (COUNTED-STRING 1) that this function will expand into something else.

BYTE-ORDER - :LITTLE-ENDIAN or :BIG-ENDIAN.
TERMINATOR - A SIMPLE-ARRAY that will be matched against the input to determine the end of a string.
If the TYPE is itself a SIMPLE-ARRAY, TERMINATOR can be a function, which will be passed
each element read. (TODO: Actually implement that function part)
READER - A user-specified function that overrides the reader that this function would otherwise generate.
WRITER - A user-specified writer function that overrides the default writer.
STREAM-SYMBOL - The name that will be given to the input and output stream.

PREVIOUS-DEFS-SYMBOL - A symbol that will be bound to a list of LET bindings at runtime. In the event of
an EVAL type, code is generated that will splice the LET bindings found here
into a runtime-constructed LET form that will then be EVAL’d.
BYTE-COUNT-NAME - The name of the variable that will be bound to the number of bytes read or written so far. ALIGN - The alignment boundary
ELEMENT-ALIGN - The alignment boundary for individual elements in an array.
BIND-INDEX-TO - In array reads and writes, may specify a variable to bind the loop index to.
Or it can be NIL.

Package

lisp-binary

Source

binary-2.lisp (file)

Function: expand-previous-defs SYMBOL VALUE FORM
Package

lisp-binary

Source

binary-1.lisp (file)

Function: expand-read/write-binary-type-body FIELD-NAME VALUE STREAM-NAME STREAM READ/WRITE-FORM
Package

lisp-binary

Source

binary-1.lisp (file)

Function: expand-struct-like-defclass-slot CLASS-NAME NAME DEFAULT-VALUE &key TYPE
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: exponent-all-ones-p ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: exponent-zero-p ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: externally-byte-aligned-p FIELD-DESCRIPTIONS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: field-description-plist FIELD-DESCRIPTION
Package

lisp-binary

Source

binary-2.lisp (file)

Function: field-description-type FIELD-DESCRIPTION
Package

lisp-binary

Source

binary-2.lisp (file)

Function: field-option FIELD-DESCRIPTION OPTION &optional DEFAULT
Package

lisp-binary

Source

binary-2.lisp (file)

Function: find-bit-field-groups LIST &key KEY

Identifies those fields in the LIST of fields that must be read/written either as a BIT-FIELD or through a BIT-STREAM wrapper. A list of the original fields is returned, with those groups that will be read/written in a non-byte-aligned mode grouped
in sublists.

See also: TYPE-SIZE

Package

lisp-binary

Source

binary-2.lisp (file)

Function: float-coerce ()

Coerce the VALUE to the RESULT-TYPE, taking into account the fact that values
generated by this library are not always actually numbers. So on Lisp systems that don’t support infinity, (FLOAT-COERCE :+INF ’DOUBLE-FLOAT) will actually leave it alone.

Also takes into account the fact that even on Lisps that do support infinities and NaNs, you can’t coerce them to non-floating-point numbers, so it passes infinities and NaNs through untouched if the RESULT-TYPE isn’t floating-point.

There should never be an error as a result of trying to decode a floating-point bit pattern to a number.

Package

lisp-binary/float

Source

float.lisp (file)

Function: float-value ()

Given the decoded parameters of a floating-point number, calculate its numerical value.

Package

lisp-binary/float

Source

float.lisp (file)

Function: format-size ()

Returns the size in bytes of a given floating-point format.

Package

lisp-binary/float

Source

float.lisp (file)

Function: get-base-pointer-tag TAG
Package

lisp-binary

Source

binary-1.lisp (file)

Function: get-enum-definition SYMBOL
Package

lisp-binary

Source

binary-1.lisp (file)

Function: get-enum-name ENUM VALUE

Returns the name that corresponds to the VALUE in the given ENUM.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: get-enum-value ENUM SYMBOL
Package

lisp-binary

Source

binary-1.lisp (file)

Function: get-exponent ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: get-format ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: get-significand ()

Given an INTEGER that represents the bit-pattern of a floating point number, extract the bits that represent the significand. SIGNIFICAND-BITS specifies the number of bits in the significand. Does not add the implicit bit.

Package

lisp-binary/float

Source

float.lisp (file)

Function: get-tag TAG
Package

lisp-binary

Source

binary-1.lisp (file)

Function: get-type-fields TYPE-NAME
Package

lisp-binary

Source

binary-1.lisp (file)

Function: group-write-forms STREAM-NAMES WRITE-FORMS

Groups a list of WRITE-FORMS according to which stream they write to. The streams are identified by matching them to their names, which must be given in STREAM-NAMES.

Package

lisp-binary

Source

binary-2.lisp (file)

Function: init-read STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: init-write STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: list-begins-with-p LIST PREFIX &key TEST
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: list-of-fields-p DATUM
Package

lisp-binary

Source

binary-2.lisp (file)

Function: load-offset OFFSET
Package

lisp-binary

Source

binary-1.lisp (file)

Function: make-binary-field &key (NAME NAME) (DEFSTRUCT-FIELD DEFSTRUCT-FIELD) (READ-FORM READ-FORM) (WRITE-FORM WRITE-FORM) (TYPE TYPE) (BIT-STREAM-ID BIT-STREAM-ID)
Package

lisp-binary

Source

binary-1.lisp (file)

Function: make-bit-field SOURCE-FIELDS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: make-enum-definition &key (NAME NAME) (SIZE SIZE) (SIGNED SIGNED) (BYTE-ORDER BYTE-ORDER) (VARIABLES VARIABLES)
Package

lisp-binary

Source

binary-1.lisp (file)

Function: make-fixed-length-string NORMAL-STRING REQUIRED-LENGTH EXTERNAL-FORMAT &optional PADDING-CHARACTER

Creates a FIXED-LENGTH-STRING and encodes it for writing. The REQUIRED-LENGTH is the length in bytes of the string
after encoding. The EXTERNAL-FORMAT is any value accepted by the FLEXI-STREAMS library as an external-format.

If the NORMAL-STRING is longer than the REQUIRED-LENGTH after encoding without any padding, then a condition of type INPUT-STRING-TOO-LONG is raised. The restart CL:TRUNCATE tells this function to truncate the string to the required
length.

FIXME:

There is still a potential problem here. Suppose that getting to the REQUIRED-LENGTH requires adding an odd number
of bytes, but the PADDING-CHARACTER is encoded as an even number of bytes. Then this function would loop forever.

Alternately, suppose that the input is too long, and the TRUNCATE restart is chosen. If the input is one byte longer
than the REQUIRED-LENGTH, but the last character in the string is encoded as two bytes, then MAKE-TRUNCATED-FIXED-LENGTH-STRING will never find the right number of characters to trim (the answer is to trim the two-byte character and then pad with a one-byte character). I need to find concrete examples of this. These examples are likely to be found in the UTF-8 encoding.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: make-infinity ()

Creates a floating-point infinity. Returns the integer bit pattern.

Package

lisp-binary/float

Source

float.lisp (file)

Function: make-largest-denormal ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: make-lookup-table BITS
Package

reverse-stream

Source

reverse-stream.lisp (file)

Function: make-out-pointer &key (OFFSET-POSITION OFFSET-POSITION) (OFFSET-SIZE/BYTES OFFSET-SIZE/BYTES) (OFFSET-BYTE-ORDER OFFSET-BYTE-ORDER) (OFFSET-SIGNEDNESS OFFSET-SIGNEDNESS) (DATA-TO-STORE DATA-TO-STORE) (CLOSURE CLOSURE)
Package

lisp-binary

Source

binary-1.lisp (file)

Function: make-quiet-nan ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: make-signalling-nan ()
Package

lisp-binary/float

Source

float.lisp (file)

Function: make-simple-array COMPLEX-ARR ELEMENT-TYPE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: make-smallest-denormal ()

FIXME: The actual smallest denormal for :SINGLE should be 2^-149, not 2^-127. I have no idea how to derive that value, so I don’t know what it should be for other types, nor what the largest denormal value should be.

Package

lisp-binary/float

Source

float.lisp (file)

Function: make-truncated-fixed-length-string NORMAL-STRING REQUIRED-LENGTH EXTERNAL-FORMAT
Package

lisp-binary

Source

binary-1.lisp (file)

Function: make-virtual-type &key (NAME NAME) (LAMBDA-LIST LAMBDA-LIST) (READER READER) (WRITER WRITER) (LISP-TYPE LISP-TYPE) (ESTIMATED-TOTAL-BITS ESTIMATED-TOTAL-BITS) (STREAM-REQUIRED STREAM-REQUIRED) (CAN-BE-IN-BIT-FIELD CAN-BE-IN-BIT-FIELD)
Package

lisp-binary

Source

binary-1.lisp (file)

Function: optimize-let-values LET LET-VALUES BINDINGS BODY
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: out-pointer-closure INSTANCE
Function: (setf out-pointer-closure) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: out-pointer-data-to-store INSTANCE
Function: (setf out-pointer-data-to-store) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: out-pointer-offset-byte-order INSTANCE
Function: (setf out-pointer-offset-byte-order) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: out-pointer-offset-position INSTANCE
Function: (setf out-pointer-offset-position) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: out-pointer-offset-signedness INSTANCE
Function: (setf out-pointer-offset-signedness) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: out-pointer-offset-size/bytes INSTANCE
Function: (setf out-pointer-offset-size/bytes) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: out-pointer-p OBJECT
Package

lisp-binary

Source

binary-1.lisp (file)

Function: push-to-tag OBJ TAG

Add the OBJ to the queue for TAG.

This is the shittiest implementation ever. It functionally rebuilds the entire tag list each time it runs, sometimes discarding this rebuild and going with the original version.

There are several reasons for this. First, the tag system can tolerate a direct SETF of *QUEUED-POINTERS*, but it cannot tolerate mutation of the underlying data structure. That is because I’m attempting to rely on the way special variables work in multithreaded Lisps as a source of thread safety. Mutating *QUEUED-POINTERS* with RPLACA or RPLACD could be seen
in another thread, but rebuilding the list and SETFing it will not affect other threads.

FIXME: This approach doesn’t provide thread safety unless every
thread binds *QUEUED-POINTERS* with a LET or LAMBDA form. The
WRITE-BINARY method can’t do this because it must be able to
push items onto the tag that can be seen by other implementations
of WRITE-BINARY that might have the corresponding DUMP-TAG call.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: queue-write-pointer TAG OFFSET-POSITION OFFSET-SIZE/BYTES OFFSET-BYTE-ORDER OFFSET-SIGNEDNESS DATA-TO-STORE CLOSURE

Queue some data along with a closure to write it at a later time, and arrange for its address to be written to the OFFSET-POSITION at that time.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: read-bits/big-endian BITS STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: read-bits/little-endian BITS STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: read-partial-byte/big-endian BITS STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: read-partial-byte/little-endian BITS STREAM
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: remove-all-restart-case FORM

Strips out all RESTART-CASE forms from the FORM, replacing them with their value form. Improves performance at the cost of easy error recovery.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: remove-double-multiple-value-bind FORM
Package

lisp-binary

Source

binary-1.lisp (file)

Function: remove-impossible-error-checks FORM
Package

lisp-binary

Source

binary-1.lisp (file)

Function: reset-op STREAM OP
Package

simple-bit-stream

Source

simple-bit-stream.lisp (file)

Function: reverse-bit-stream-groups BIT-STREAM-HASH REAL-STREAM-SYMBOL LET-DEFS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: reverse-byte BYTE LOOKUP-TABLE
Package

reverse-stream

Source

reverse-stream.lisp (file)

Function: right-pad STRING PAD-LENGTH PADDING-CHARACTER

Pads the STRING with PAD-LENGTH copies of the PADDING-CHARACTER. If PAD-LENGTH is negative, removes characters from the right end of the string instead.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: runtime-reader/writer-form READER-OR-WRITER BYTE-COUNT-NAME BYTE-COUNT STREAM-SYMBOL STREAM LET-DEFS

Wraps READER-OR-WRITER in the lexical context required for it to work. READER-OR-WRITER is a reader or writer form generated by EXPAND-DEFBINARY-TYPE-FIELD at runtime as a result of an EVAL type specifier being used. This form assumes that it will be spliced into the body of a READ-BINARY or WRITE-BINARY method, where certain variables are bound. Since the EVAL type specifier produces code that will use this form in an EVAL, the values that would normally be bound must be added with a LET form.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: simple-array-p OBJ
Package

lisp-binary

Source

binary-1.lisp (file)

Function: take-while PRED LIST
Package

lisp-binary-utils

Source

utils.lisp (file)

Function: type-size TYPE-SPEC

Determines the size in bits of a DEFBINARY type, for the purposes
of determining whether reading the field requires doing non-byte-aligned I/O.

The types accepted are those handled by EXPAND-DEFBINARY-TYPE-FIELD.

It relies on a few simplifications when it comes to arrays and strings, which allow it to not need to know the exact size of the array, only the count size and the size of the element-type.

Returns three values:

- The (approximate) number of bits that the field will take up.
- T if the field could be treated as part of a BIT-FIELD, or
NIL if it can only be read using a BIT-STREAM. BIT-FIELD support
is limited to UNSIGNED-BYTEs and SIGNED-BYTEs.
- :BIT-STREAM-ONLY if the field generates so much alignment uncertainty that the whole structure and everything thereafter must be read
from a BIT-STREAM, and :NORMAL-STREAM if it’s okay to read
byte-aligned parts of the struct from a regular stream.

Package

lisp-binary

Source

binary-1.lisp (file)

Function: var-bit-stream VAR BIT-STREAM-GROUPS
Package

lisp-binary

Source

binary-2.lisp (file)

Function: virtual-type-can-be-in-bit-field INSTANCE
Function: (setf virtual-type-can-be-in-bit-field) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-estimated-total-bits INSTANCE
Function: (setf virtual-type-estimated-total-bits) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-lambda-list INSTANCE
Function: (setf virtual-type-lambda-list) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-lisp-type INSTANCE
Function: (setf virtual-type-lisp-type) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-name INSTANCE
Function: (setf virtual-type-name) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-p OBJECT
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-reader INSTANCE
Function: (setf virtual-type-reader) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-stream-required INSTANCE
Function: (setf virtual-type-stream-required) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)

Function: virtual-type-writer INSTANCE
Function: (setf virtual-type-writer) VALUE INSTANCE
Package

lisp-binary

Source

binary-1.lisp (file)


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

5.2.4 Generic functions

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

lisp-binary

Methods
Method: defbinary-type-align (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-align) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: defbinary-type-bind-index-to OBJECT
Generic Function: (setf defbinary-type-bind-index-to) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: defbinary-type-bind-index-to (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-bind-index-to) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: defbinary-type-byte-count-name OBJECT
Generic Function: (setf defbinary-type-byte-count-name) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: defbinary-type-byte-count-name (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-byte-count-name) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: defbinary-type-byte-order OBJECT
Generic Function: (setf defbinary-type-byte-order) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: defbinary-type-byte-order (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-byte-order) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: defbinary-type-element-align OBJECT
Generic Function: (setf defbinary-type-element-align) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: defbinary-type-element-align (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-element-align) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

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

lisp-binary

Methods
Method: defbinary-type-name (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-name) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: defbinary-type-previous-defs-symbol OBJECT
Generic Function: (setf defbinary-type-previous-defs-symbol) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: defbinary-type-previous-defs-symbol (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-previous-defs-symbol) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

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

lisp-binary

Methods
Method: defbinary-type-reader (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-reader) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: defbinary-type-stream-symbol OBJECT
Generic Function: (setf defbinary-type-stream-symbol) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: defbinary-type-stream-symbol (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-stream-symbol) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

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

lisp-binary

Methods
Method: defbinary-type-type (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-type) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

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

lisp-binary

Methods
Method: defbinary-type-writer (DEFBINARY-TYPE defbinary-type)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf defbinary-type-writer) NEW-VALUE (DEFBINARY-TYPE defbinary-type)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: pointer-base-pointer OBJECT
Generic Function: (setf pointer-base-pointer) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: pointer-base-pointer (POINTER pointer)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf pointer-base-pointer) NEW-VALUE (POINTER pointer)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: pointer-offset OBJECT
Generic Function: (setf pointer-offset) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: pointer-offset (POINTER pointer)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf pointer-offset) NEW-VALUE (POINTER pointer)

automatically generated writer method

Source

binary-1.lisp (file)

Generic Function: pointer-stream OBJECT
Generic Function: (setf pointer-stream) NEW-VALUE OBJECT
Package

lisp-binary

Methods
Method: pointer-stream (POINTER pointer)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf pointer-stream) NEW-VALUE (POINTER pointer)

automatically generated writer method

Source

binary-1.lisp (file)

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

lisp-binary

Methods
Method: pointer-type (POINTER pointer)

automatically generated reader method

Source

binary-1.lisp (file)

Method: (setf pointer-type) NEW-VALUE (POINTER pointer)

automatically generated writer method

Source

binary-1.lisp (file)


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

5.2.5 Conditions

Condition: unknown-type-size ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

simple-error (condition)

Condition: unspecified-type-error ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

simple-condition (condition)


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

5.2.6 Structures

Structure: binary-field ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: name
Readers

binary-field-name (function)

Writers

(setf binary-field-name) (function)

Slot: defstruct-field
Readers

binary-field-defstruct-field (function)

Writers

(setf binary-field-defstruct-field) (function)

Slot: read-form
Readers

binary-field-read-form (function)

Writers

(setf binary-field-read-form) (function)

Slot: write-form
Readers

binary-field-write-form (function)

Writers

(setf binary-field-write-form) (function)

Slot: type
Readers

binary-field-type (function)

Writers

(setf binary-field-type) (function)

Slot: bit-stream-id
Readers

binary-field-bit-stream-id (function)

Writers

(setf binary-field-bit-stream-id) (function)

Structure: enum-definition ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: name
Type

symbol

Readers

enum-definition-name (function)

Writers

(setf enum-definition-name) (function)

Slot: size
Type

number

Initform

0

Readers

enum-definition-size (function)

Writers

(setf enum-definition-size) (function)

Slot: signed
Type

boolean

Readers

enum-definition-signed (function)

Writers

(setf enum-definition-signed) (function)

Slot: byte-order
Type

keyword

Initform

:little-endian

Readers

enum-definition-byte-order (function)

Writers

(setf enum-definition-byte-order) (function)

Slot: variables
Type

list

Readers

enum-definition-variables (function)

Writers

(setf enum-definition-variables) (function)

Structure: out-pointer ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: offset-position
Type

number

Initform

0

Readers

out-pointer-offset-position (function)

Writers

(setf out-pointer-offset-position) (function)

Slot: offset-size/bytes
Type

number

Initform

0

Readers

out-pointer-offset-size/bytes (function)

Writers

(setf out-pointer-offset-size/bytes) (function)

Slot: offset-byte-order
Type

keyword

Initform

:little-endian

Readers

out-pointer-offset-byte-order (function)

Writers

(setf out-pointer-offset-byte-order) (function)

Slot: offset-signedness
Type

boolean

Readers

out-pointer-offset-signedness (function)

Writers

(setf out-pointer-offset-signedness) (function)

Slot: data-to-store
Readers

out-pointer-data-to-store (function)

Writers

(setf out-pointer-data-to-store) (function)

Slot: closure
Type

function

Initform

(function identity)

Readers

out-pointer-closure (function)

Writers

(setf out-pointer-closure) (function)

Structure: virtual-type ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: name
Readers

virtual-type-name (function)

Writers

(setf virtual-type-name) (function)

Slot: lambda-list
Readers

virtual-type-lambda-list (function)

Writers

(setf virtual-type-lambda-list) (function)

Slot: reader
Readers

virtual-type-reader (function)

Writers

(setf virtual-type-reader) (function)

Slot: writer
Readers

virtual-type-writer (function)

Writers

(setf virtual-type-writer) (function)

Slot: lisp-type
Readers

virtual-type-lisp-type (function)

Writers

(setf virtual-type-lisp-type) (function)

Slot: estimated-total-bits
Initform

8

Readers

virtual-type-estimated-total-bits (function)

Writers

(setf virtual-type-estimated-total-bits) (function)

Slot: stream-required
Initform

:normal-stream

Readers

virtual-type-stream-required (function)

Writers

(setf virtual-type-stream-required) (function)

Slot: can-be-in-bit-field
Readers

virtual-type-can-be-in-bit-field (function)

Writers

(setf virtual-type-can-be-in-bit-field) (function)


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

5.2.7 Classes

Class: defbinary-type ()
Package

lisp-binary

Source

binary-1.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

defbinary-type-name (generic function)

Writers

(setf defbinary-type-name) (generic function)

Slot: type
Initargs

:type

Readers

defbinary-type-type (generic function)

Writers

(setf defbinary-type-type) (generic function)

Slot: byte-order
Type

symbol

Initargs

:byte-order

Initform

:little-endian

Readers

defbinary-type-byte-order (generic function)

Writers

(setf defbinary-type-byte-order) (generic function)

Slot: reader
Initargs

:reader

Readers

defbinary-type-reader (generic function)

Writers

(setf defbinary-type-reader) (generic function)

Slot: writer
Initargs

:writer

Readers

defbinary-type-writer (generic function)

Writers

(setf defbinary-type-writer) (generic function)

Slot: stream-symbol
Initargs

:stream-symbol

Readers

defbinary-type-stream-symbol (generic function)

Writers

(setf defbinary-type-stream-symbol) (generic function)

Slot: previous-defs-symbol
Initargs

:previous-defs-symbol

Readers

defbinary-type-previous-defs-symbol (generic function)

Writers

(setf defbinary-type-previous-defs-symbol) (generic function)

Slot: byte-count-name
Initargs

:byte-count-name

Readers

defbinary-type-byte-count-name (generic function)

Writers

(setf defbinary-type-byte-count-name) (generic function)

Slot: align
Initargs

:align

Readers

defbinary-type-align (generic function)

Writers

(setf defbinary-type-align) (generic function)

Slot: element-align
Initargs

:element-align

Readers

defbinary-type-element-align (generic function)

Writers

(setf defbinary-type-element-align) (generic function)

Slot: bind-index-to
Initargs

:bind-index-to

Readers

defbinary-type-bind-index-to (generic function)

Writers

(setf defbinary-type-bind-index-to) (generic function)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L  
Index Entry  Section

F
File, Lisp, lisp-binary.asd: The lisp-binary<dot>asd file
File, Lisp, lisp-binary/binary-1.lisp: The lisp-binary/binary-1<dot>lisp file
File, Lisp, lisp-binary/binary-2.lisp: The lisp-binary/binary-2<dot>lisp file
File, Lisp, lisp-binary/float.lisp: The lisp-binary/float<dot>lisp file
File, Lisp, lisp-binary/integer.lisp: The lisp-binary/integer<dot>lisp file
File, Lisp, lisp-binary/reverse-stream.lisp: The lisp-binary/reverse-stream<dot>lisp file
File, Lisp, lisp-binary/simple-bit-stream.lisp: The lisp-binary/simple-bit-stream<dot>lisp file
File, Lisp, lisp-binary/utils.lisp: The lisp-binary/utils<dot>lisp file

L
Lisp File, lisp-binary.asd: The lisp-binary<dot>asd file
Lisp File, lisp-binary/binary-1.lisp: The lisp-binary/binary-1<dot>lisp file
Lisp File, lisp-binary/binary-2.lisp: The lisp-binary/binary-2<dot>lisp file
Lisp File, lisp-binary/float.lisp: The lisp-binary/float<dot>lisp file
Lisp File, lisp-binary/integer.lisp: The lisp-binary/integer<dot>lisp file
Lisp File, lisp-binary/reverse-stream.lisp: The lisp-binary/reverse-stream<dot>lisp file
Lisp File, lisp-binary/simple-bit-stream.lisp: The lisp-binary/simple-bit-stream<dot>lisp file
Lisp File, lisp-binary/utils.lisp: The lisp-binary/utils<dot>lisp file
lisp-binary.asd: The lisp-binary<dot>asd file
lisp-binary/binary-1.lisp: The lisp-binary/binary-1<dot>lisp file
lisp-binary/binary-2.lisp: The lisp-binary/binary-2<dot>lisp file
lisp-binary/float.lisp: The lisp-binary/float<dot>lisp file
lisp-binary/integer.lisp: The lisp-binary/integer<dot>lisp file
lisp-binary/reverse-stream.lisp: The lisp-binary/reverse-stream<dot>lisp file
lisp-binary/simple-bit-stream.lisp: The lisp-binary/simple-bit-stream<dot>lisp file
lisp-binary/utils.lisp: The lisp-binary/utils<dot>lisp file

Jump to:   F   L  

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

A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   I   J   L   M   N   O   P   Q   R   S   T   U   V   W  
Index Entry  Section

%
%infinityp: Internal functions
%make-infinity: Internal functions
%make-quiet-nan: Internal functions
%make-reader-let-def: Internal functions
%make-signalling-nan: Internal functions
%qnanp: Internal functions
%read-float: Internal functions
%snanp: Internal functions
%stream-read-sequence: Internal functions
%stream-read-sequence: Internal functions
%stream-write-sequence: Internal functions
%stream-write-sequence: Internal functions
%write-float: Internal functions

(
(setf binary-field-bit-stream-id): Internal functions
(setf binary-field-defstruct-field): Internal functions
(setf binary-field-name): Internal functions
(setf binary-field-read-form): Internal functions
(setf binary-field-type): Internal functions
(setf binary-field-write-form): Internal functions
(setf defbinary-type-align): Internal generic functions
(setf defbinary-type-align): Internal generic functions
(setf defbinary-type-bind-index-to): Internal generic functions
(setf defbinary-type-bind-index-to): Internal generic functions
(setf defbinary-type-byte-count-name): Internal generic functions
(setf defbinary-type-byte-count-name): Internal generic functions
(setf defbinary-type-byte-order): Internal generic functions
(setf defbinary-type-byte-order): Internal generic functions
(setf defbinary-type-element-align): Internal generic functions
(setf defbinary-type-element-align): Internal generic functions
(setf defbinary-type-name): Internal generic functions
(setf defbinary-type-name): Internal generic functions
(setf defbinary-type-previous-defs-symbol): Internal generic functions
(setf defbinary-type-previous-defs-symbol): Internal generic functions
(setf defbinary-type-reader): Internal generic functions
(setf defbinary-type-reader): Internal generic functions
(setf defbinary-type-stream-symbol): Internal generic functions
(setf defbinary-type-stream-symbol): Internal generic functions
(setf defbinary-type-type): Internal generic functions
(setf defbinary-type-type): Internal generic functions
(setf defbinary-type-writer): Internal generic functions
(setf defbinary-type-writer): Internal generic functions
(setf enum-definition-byte-order): Internal functions
(setf enum-definition-name): Internal functions
(setf enum-definition-signed): Internal functions
(setf enum-definition-size): Internal functions
(setf enum-definition-variables): Internal functions
(setf out-pointer-closure): Internal functions
(setf out-pointer-data-to-store): Internal functions
(setf out-pointer-offset-byte-order): Internal functions
(setf out-pointer-offset-position): Internal functions
(setf out-pointer-offset-signedness): Internal functions
(setf out-pointer-offset-size/bytes): Internal functions
(setf pointer-base-pointer): Internal generic functions
(setf pointer-base-pointer): Internal generic functions
(setf pointer-offset): Internal generic functions
(setf pointer-offset): Internal generic functions
(setf pointer-stream): Internal generic functions
(setf pointer-stream): Internal generic functions
(setf pointer-type): Internal generic functions
(setf pointer-type): Internal generic functions
(setf virtual-type-can-be-in-bit-field): Internal functions
(setf virtual-type-estimated-total-bits): Internal functions
(setf virtual-type-lambda-list): Internal functions
(setf virtual-type-lisp-type): Internal functions
(setf virtual-type-name): Internal functions
(setf virtual-type-reader): Internal functions
(setf virtual-type-stream-required): Internal functions
(setf virtual-type-writer): Internal functions

A
acond: Internal macros
add-base-pointer-tag: Internal functions
add-bit-stream-id: Internal functions
add-bit-stream-vars: Internal functions
add-default-value-if-needed: Internal functions
add-stream-definitions: Internal functions
aif: Exported macros
align-to-boundary: Internal functions
array-pop: Internal functions
assoc-cdr: Exported functions
awhen: Exported macros

B
binary-field-bit-stream-id: Internal functions
binary-field-defstruct-field: Internal functions
binary-field-name: Internal functions
binary-field-p: Internal functions
binary-field-read-form: Internal functions
binary-field-type: Internal functions
binary-field-write-form: Internal functions
bind-class-slots: Exported macros
bit-field-type-p: Internal functions
bitfield-spec->defstruct-specs: Internal functions
buffer: Exported functions
build-virtual-type-reader/writer-expander: Internal functions
byte-aligned-p: Exported functions

C
calculate-exponent: Internal functions
calculate-significand: Internal functions
clear-tag: Internal functions
combine-field-descriptions: Internal functions
compute-reversed-byte: Internal functions
convert-to-bit-fields: Internal functions
copy-binary-field: Internal functions
copy-enum-definition: Internal functions
copy-out-pointer: Internal functions
copy-virtual-type: Internal functions

D
decode-float-bits: Exported macros
decode-float-bits/arithmetic: Internal functions
decode-float-bits/cffi: Internal functions
decode-ip-addr: Exported functions
decode-lsb: Exported functions
decode-msb: Exported functions
decode-significand: Internal functions
defbinary: Exported macros
defbinary-constructor-name: Internal functions
defbinary-type-align: Internal generic functions
defbinary-type-align: Internal generic functions
defbinary-type-bind-index-to: Internal generic functions
defbinary-type-bind-index-to: Internal generic functions
defbinary-type-byte-count-name: Internal generic functions
defbinary-type-byte-count-name: Internal generic functions
defbinary-type-byte-order: Internal generic functions
defbinary-type-byte-order: Internal generic functions
defbinary-type-element-align: Internal generic functions
defbinary-type-element-align: Internal generic functions
defbinary-type-name: Internal generic functions
defbinary-type-name: Internal generic functions
defbinary-type-previous-defs-symbol: Internal generic functions
defbinary-type-previous-defs-symbol: Internal generic functions
defbinary-type-reader: Internal generic functions
defbinary-type-reader: Internal generic functions
defbinary-type-stream-symbol: Internal generic functions
defbinary-type-stream-symbol: Internal generic functions
defbinary-type-type: Internal generic functions
defbinary-type-type: Internal generic functions
defbinary-type-writer: Internal generic functions
defbinary-type-writer: Internal generic functions
define-enum: Exported macros
define-virtual-type: Internal macros
denormalp: Internal functions
denormalp/arithmetic: Internal functions
destructuring-case: Exported macros
divisiblep: Exported functions
dump-tag: Internal functions

E
encode-float-bits: Exported macros
encode-float-bits/arithmetic: Internal functions
encode-float-bits/arithmetic-macro: Internal macros
encode-float-bits/cffi: Internal functions
encode-float-bits/runtime-format: Internal functions
encode-lsb: Exported functions
encode-msb: Exported functions
encode-significand: Internal functions
enum-definition-byte-order: Internal functions
enum-definition-name: Internal functions
enum-definition-p: Internal functions
enum-definition-signed: Internal functions
enum-definition-size: Internal functions
enum-definition-variables: Internal functions
enump: Internal functions
expand-byte-shorthand: Internal functions
expand-defbinary-field: Internal functions
expand-defbinary-type-field: Internal functions
expand-previous-defs: Internal functions
expand-read/write-binary-type-body: Internal functions
expand-struct-like-defclass-slot: Internal functions
exponent-all-ones-p: Internal functions
exponent-zero-p: Internal functions
externally-byte-aligned-p: Internal functions

F
field-description-plist: Internal functions
field-description-type: Internal functions
field-option: Internal functions
find-bit-field-groups: Internal functions
find-sublist: Exported functions
float-coerce: Internal functions
float-value: Internal functions
format-size: Internal functions
Function, %infinityp: Internal functions
Function, %make-infinity: Internal functions
Function, %make-quiet-nan: Internal functions
Function, %make-reader-let-def: Internal functions
Function, %make-signalling-nan: Internal functions
Function, %qnanp: Internal functions
Function, %read-float: Internal functions
Function, %snanp: Internal functions
Function, %stream-read-sequence: Internal functions
Function, %stream-read-sequence: Internal functions
Function, %stream-write-sequence: Internal functions
Function, %stream-write-sequence: Internal functions
Function, %write-float: Internal functions
Function, (setf binary-field-bit-stream-id): Internal functions
Function, (setf binary-field-defstruct-field): Internal functions
Function, (setf binary-field-name): Internal functions
Function, (setf binary-field-read-form): Internal functions
Function, (setf binary-field-type): Internal functions
Function, (setf binary-field-write-form): Internal functions
Function, (setf enum-definition-byte-order): Internal functions
Function, (setf enum-definition-name): Internal functions
Function, (setf enum-definition-signed): Internal functions
Function, (setf enum-definition-size): Internal functions
Function, (setf enum-definition-variables): Internal functions
Function, (setf out-pointer-closure): Internal functions
Function, (setf out-pointer-data-to-store): Internal functions
Function, (setf out-pointer-offset-byte-order): Internal functions
Function, (setf out-pointer-offset-position): Internal functions
Function, (setf out-pointer-offset-signedness): Internal functions
Function, (setf out-pointer-offset-size/bytes): Internal functions
Function, (setf virtual-type-can-be-in-bit-field): Internal functions
Function, (setf virtual-type-estimated-total-bits): Internal functions
Function, (setf virtual-type-lambda-list): Internal functions
Function, (setf virtual-type-lisp-type): Internal functions
Function, (setf virtual-type-name): Internal functions
Function, (setf virtual-type-reader): Internal functions
Function, (setf virtual-type-stream-required): Internal functions
Function, (setf virtual-type-writer): Internal functions
Function, add-base-pointer-tag: Internal functions
Function, add-bit-stream-id: Internal functions
Function, add-bit-stream-vars: Internal functions
Function, add-default-value-if-needed: Internal functions
Function, add-stream-definitions: Internal functions
Function, align-to-boundary: Internal functions
Function, array-pop: Internal functions
Function, assoc-cdr: Exported functions
Function, binary-field-bit-stream-id: Internal functions
Function, binary-field-defstruct-field: Internal functions
Function, binary-field-name: Internal functions
Function, binary-field-p: Internal functions
Function, binary-field-read-form: Internal functions
Function, binary-field-type: Internal functions
Function, binary-field-write-form: Internal functions
Function, bit-field-type-p: Internal functions
Function, bitfield-spec->defstruct-specs: Internal functions
Function, buffer: Exported functions
Function, build-virtual-type-reader/writer-expander: Internal functions
Function, byte-aligned-p: Exported functions
Function, calculate-exponent: Internal functions
Function, calculate-significand: Internal functions
Function, clear-tag: Internal functions
Function, combine-field-descriptions: Internal functions
Function, compute-reversed-byte: Internal functions
Function, convert-to-bit-fields: Internal functions
Function, copy-binary-field: Internal functions
Function, copy-enum-definition: Internal functions
Function, copy-out-pointer: Internal functions
Function, copy-virtual-type: Internal functions
Function, decode-float-bits/arithmetic: Internal functions
Function, decode-float-bits/cffi: Internal functions
Function, decode-ip-addr: Exported functions
Function, decode-lsb: Exported functions
Function, decode-msb: Exported functions
Function, decode-significand: Internal functions
Function, defbinary-constructor-name: Internal functions
Function, denormalp: Internal functions
Function, denormalp/arithmetic: Internal functions
Function, divisiblep: Exported functions
Function, dump-tag: Internal functions
Function, encode-float-bits/arithmetic: Internal functions
Function, encode-float-bits/cffi: Internal functions
Function, encode-float-bits/runtime-format: Internal functions
Function, encode-lsb: Exported functions
Function, encode-msb: Exported functions
Function, encode-significand: Internal functions
Function, enum-definition-byte-order: Internal functions
Function, enum-definition-name: Internal functions
Function, enum-definition-p: Internal functions
Function, enum-definition-signed: Internal functions
Function, enum-definition-size: Internal functions
Function, enum-definition-variables: Internal functions
Function, enump: Internal functions
Function, expand-byte-shorthand: Internal functions
Function, expand-defbinary-field: Internal functions
Function, expand-defbinary-type-field: Internal functions
Function, expand-previous-defs: Internal functions
Function, expand-read/write-binary-type-body: Internal functions
Function, expand-struct-like-defclass-slot: Internal functions
Function, exponent-all-ones-p: Internal functions
Function, exponent-zero-p: Internal functions
Function, externally-byte-aligned-p: Internal functions
Function, field-description-plist: Internal functions
Function, field-description-type: Internal functions
Function, field-option: Internal functions
Function, find-bit-field-groups: Internal functions
Function, find-sublist: Exported functions
Function, float-coerce: Internal functions
Function, float-value: Internal functions
Function, format-size: Internal functions
Function, get-base-pointer-tag: Internal functions
Function, get-enum-definition: Internal functions
Function, get-enum-name: Internal functions
Function, get-enum-value: Internal functions
Function, get-exponent: Internal functions
Function, get-format: Internal functions
Function, get-lsb-byte: Exported functions
Function, get-significand: Internal functions
Function, get-tag: Internal functions
Function, get-type-fields: Internal functions
Function, group: Exported functions
Function, group-write-forms: Internal functions
Function, infinityp: Exported functions
Function, init-read: Internal functions
Function, init-write: Internal functions
Function, insert-before: Exported functions
Function, join-field-bits: Exported functions
Function, list-begins-with-p: Internal functions
Function, list-of-fields-p: Internal functions
Function, load-offset: Internal functions
Function, make-binary-field: Internal functions
Function, make-bit-field: Internal functions
Function, make-enum-definition: Internal functions
Function, make-fixed-length-string: Internal functions
Function, make-infinity: Internal functions
Function, make-largest-denormal: Internal functions
Function, make-lookup-table: Internal functions
Function, make-out-pointer: Internal functions
Function, make-quiet-nan: Internal functions
Function, make-signalling-nan: Internal functions
Function, make-simple-array: Internal functions
Function, make-smallest-denormal: Internal functions
Function, make-truncated-fixed-length-string: Internal functions
Function, make-virtual-type: Internal functions
Function, mapseq: Exported functions
Function, nanp: Exported functions
Function, open-binary: Exported functions
Function, optimize-let-values: Internal functions
Function, out-pointer-closure: Internal functions
Function, out-pointer-data-to-store: Internal functions
Function, out-pointer-offset-byte-order: Internal functions
Function, out-pointer-offset-position: Internal functions
Function, out-pointer-offset-signedness: Internal functions
Function, out-pointer-offset-size/bytes: Internal functions
Function, out-pointer-p: Internal functions
Function, plist-replace: Exported functions
Function, push-to-tag: Internal functions
Function, queue-write-pointer: Internal functions
Function, read-binary-type: Exported functions
Function, read-bits: Exported functions
Function, read-bits/big-endian: Internal functions
Function, read-bits/little-endian: Internal functions
Function, read-bytes-with-partial: Exported functions
Function, read-counted-string: Exported functions
Function, read-enum: Exported functions
Function, read-file: Exported functions
Function, read-integer: Exported functions
Function, read-partial-byte/big-endian: Internal functions
Function, read-partial-byte/little-endian: Internal functions
Function, read-terminated-string: Exported functions
Function, recursive-find: Exported functions
Function, recursive-find-if: Exported functions
Function, recursive-find-sublist: Exported functions
Function, recursive-find/collect: Exported functions
Function, recursive-map: Exported functions
Function, recursive-mapcar: Exported functions
Function, relative-file-position: Exported functions
Function, remove-all-restart-case: Internal functions
Function, remove-binding: Exported functions
Function, remove-double-multiple-value-bind: Internal functions
Function, remove-impossible-error-checks: Internal functions
Function, remove-plist-keys: Exported functions
Function, reset-op: Internal functions
Function, reverse-bit-stream-groups: Internal functions
Function, reverse-byte: Internal functions
Function, right-pad: Internal functions
Function, runtime-reader/writer-form: Internal functions
Function, signed->unsigned: Exported functions
Function, signed->unsigned/bits: Exported functions
Function, simple-array-p: Internal functions
Function, split-bit-field: Exported functions
Function, subst*: Exported functions
Function, take-while: Internal functions
Function, type-size: Internal functions
Function, unsigned->signed: Exported functions
Function, unsigned->signed/bits: Exported functions
Function, var-bit-stream: Internal functions
Function, virtual-type-can-be-in-bit-field: Internal functions
Function, virtual-type-estimated-total-bits: Internal functions
Function, virtual-type-lambda-list: Internal functions
Function, virtual-type-lisp-type: Internal functions
Function, virtual-type-name: Internal functions
Function, virtual-type-p: Internal functions
Function, virtual-type-reader: Internal functions
Function, virtual-type-stream-required: Internal functions
Function, virtual-type-writer: Internal functions
Function, write-binary-type: Exported functions
Function, write-bits: Exported functions
Function, write-counted-string: Exported functions
Function, write-enum: Exported functions
Function, write-integer: Exported functions
Function, write-terminated-string: Exported functions

G
Generic Function, (setf defbinary-type-align): Internal generic functions
Generic Function, (setf defbinary-type-bind-index-to): Internal generic functions
Generic Function, (setf defbinary-type-byte-count-name): Internal generic functions
Generic Function, (setf defbinary-type-byte-order): Internal generic functions
Generic Function, (setf defbinary-type-element-align): Internal generic functions
Generic Function, (setf defbinary-type-name): Internal generic functions
Generic Function, (setf defbinary-type-previous-defs-symbol): Internal generic functions
Generic Function, (setf defbinary-type-reader): Internal generic functions
Generic Function, (setf defbinary-type-stream-symbol): Internal generic functions
Generic Function, (setf defbinary-type-type): Internal generic functions
Generic Function, (setf defbinary-type-writer): Internal generic functions
Generic Function, (setf pointer-base-pointer): Internal generic functions
Generic Function, (setf pointer-offset): Internal generic functions
Generic Function, (setf pointer-stream): Internal generic functions
Generic Function, (setf pointer-type): Internal generic functions
Generic Function, defbinary-type-align: Internal generic functions
Generic Function, defbinary-type-bind-index-to: Internal generic functions
Generic Function, defbinary-type-byte-count-name: Internal generic functions
Generic Function, defbinary-type-byte-order: Internal generic functions
Generic Function, defbinary-type-element-align: Internal generic functions
Generic Function, defbinary-type-name: Internal generic functions
Generic Function, defbinary-type-previous-defs-symbol: Internal generic functions
Generic Function, defbinary-type-reader: Internal generic functions
Generic Function, defbinary-type-stream-symbol: Internal generic functions
Generic Function, defbinary-type-type: Internal generic functions
Generic Function, defbinary-type-writer: Internal generic functions
Generic Function, pointer-base-pointer: Internal generic functions
Generic Function, pointer-offset: Internal generic functions
Generic Function, pointer-stream: Internal generic functions
Generic Function, pointer-type: Internal generic functions
Generic Function, read-binary: Exported generic functions
Generic Function, read-bytes: Exported generic functions
Generic Function, wrap-in-bit-stream: Exported generic functions
Generic Function, wrap-in-reverse-stream: Exported generic functions
Generic Function, write-binary: Exported generic functions
Generic Function, write-bytes: Exported generic functions
get-base-pointer-tag: Internal functions
get-enum-definition: Internal functions
get-enum-name: Internal functions
get-enum-value: Internal functions
get-exponent: Internal functions
get-format: Internal functions
get-lsb-byte: Exported functions
get-significand: Internal functions
get-tag: Internal functions
get-type-fields: Internal functions
group: Exported functions
group-write-forms: Internal functions

I
infinityp: Exported functions
init-read: Internal functions
init-write: Internal functions
insert-before: Exported functions

J
join-field-bits: Exported functions

L
let-values*: Exported macros
let-values/stupid*: Internal macros
letf: Exported macros
list-begins-with-p: Internal functions
list-of-fields-p: Internal functions
load-offset: Internal functions

M
Macro, acond: Internal macros
Macro, aif: Exported macros
Macro, awhen: Exported macros
Macro, bind-class-slots: Exported macros
Macro, decode-float-bits: Exported macros
Macro, defbinary: Exported macros
Macro, define-enum: Exported macros
Macro, define-virtual-type: Internal macros
Macro, destructuring-case: Exported macros
Macro, encode-float-bits: Exported macros
Macro, encode-float-bits/arithmetic-macro: Internal macros
Macro, let-values*: Exported macros
Macro, let-values/stupid*: Internal macros
Macro, letf: Exported macros
Macro, make-reader-let-def: Internal macros
Macro, named-let: Exported macros
Macro, old-make-reader-let-def: Internal macros
Macro, pop-bits: Exported macros
Macro, pop-bits/le: Exported macros
Macro, popbit: Internal macros
Macro, push-bits: Exported macros
Macro, push-bits/le: Exported macros
Macro, pushover: Exported macros
Macro, read-bytes-with-partial/macro: Internal macros
Macro, read-float: Exported macros
Macro, read-octets-to-string: Internal macros
Macro, read/write-binary-type: Internal macros
Macro, simple-define-condition: Exported macros
Macro, struct-like-defclass: Exported macros
Macro, with-buffered-output: Exported macros
Macro, with-file-position: Exported macros
Macro, with-letf-bindings: Internal macros
Macro, with-local-pointer-resolving-context: Exported macros
Macro, with-open-binary-file: Exported macros
Macro, with-wrapped-in-bit-stream: Exported macros
Macro, with-wrapped-in-reverse-stream: Exported macros
Macro, write-float: Exported macros
make-binary-field: Internal functions
make-bit-field: Internal functions
make-enum-definition: Internal functions
make-fixed-length-string: Internal functions
make-infinity: Internal functions
make-largest-denormal: Internal functions
make-lookup-table: Internal functions
make-out-pointer: Internal functions
make-quiet-nan: Internal functions
make-reader-let-def: Internal macros
make-signalling-nan: Internal functions
make-simple-array: Internal functions
make-smallest-denormal: Internal functions
make-truncated-fixed-length-string: Internal functions
make-virtual-type: Internal functions
mapseq: Exported functions
Method, (setf defbinary-type-align): Internal generic functions
Method, (setf defbinary-type-bind-index-to): Internal generic functions
Method, (setf defbinary-type-byte-count-name): Internal generic functions
Method, (setf defbinary-type-byte-order): Internal generic functions
Method, (setf defbinary-type-element-align): Internal generic functions
Method, (setf defbinary-type-name): Internal generic functions
Method, (setf defbinary-type-previous-defs-symbol): Internal generic functions
Method, (setf defbinary-type-reader): Internal generic functions
Method, (setf defbinary-type-stream-symbol): Internal generic functions
Method, (setf defbinary-type-type): Internal generic functions
Method, (setf defbinary-type-writer): Internal generic functions
Method, (setf pointer-base-pointer): Internal generic functions
Method, (setf pointer-offset): Internal generic functions
Method, (setf pointer-stream): Internal generic functions
Method, (setf pointer-type): Internal generic functions
Method, defbinary-type-align: Internal generic functions
Method, defbinary-type-bind-index-to: Internal generic functions
Method, defbinary-type-byte-count-name: Internal generic functions
Method, defbinary-type-byte-order: Internal generic functions
Method, defbinary-type-element-align: Internal generic functions
Method, defbinary-type-name: Internal generic functions
Method, defbinary-type-previous-defs-symbol: Internal generic functions
Method, defbinary-type-reader: Internal generic functions
Method, defbinary-type-stream-symbol: Internal generic functions
Method, defbinary-type-type: Internal generic functions
Method, defbinary-type-writer: Internal generic functions
Method, pointer-base-pointer: Internal generic functions
Method, pointer-offset: Internal generic functions
Method, pointer-stream: Internal generic functions
Method, pointer-type: Internal generic functions
Method, read-binary: Exported generic functions
Method, read-bytes: Exported generic functions
Method, read-bytes: Exported generic functions
Method, wrap-in-bit-stream: Exported generic functions
Method, wrap-in-reverse-stream: Exported generic functions
Method, write-bytes: Exported generic functions
Method, write-bytes: Exported generic functions

N
named-let: Exported macros
nanp: Exported functions

O
old-make-reader-let-def: Internal macros
open-binary: Exported functions
optimize-let-values: Internal functions
out-pointer-closure: Internal functions
out-pointer-data-to-store: Internal functions
out-pointer-offset-byte-order: Internal functions
out-pointer-offset-position: Internal functions
out-pointer-offset-signedness: Internal functions
out-pointer-offset-size/bytes: Internal functions
out-pointer-p: Internal functions

P
plist-replace: Exported functions
pointer-base-pointer: Internal generic functions
pointer-base-pointer: Internal generic functions
pointer-offset: Internal generic functions
pointer-offset: Internal generic functions
pointer-stream: Internal generic functions
pointer-stream: Internal generic functions
pointer-type: Internal generic functions
pointer-type: Internal generic functions
pop-bits: Exported macros
pop-bits/le: Exported macros
popbit: Internal macros
push-bits: Exported macros
push-bits/le: Exported macros
push-to-tag: Internal functions
pushover: Exported macros

Q
queue-write-pointer: Internal functions

R
read-binary: Exported generic functions
read-binary: Exported generic functions
read-binary-type: Exported functions
read-bits: Exported functions
read-bits/big-endian: Internal functions
read-bits/little-endian: Internal functions
read-bytes: Exported generic functions
read-bytes: Exported generic functions
read-bytes: Exported generic functions
read-bytes-with-partial: Exported functions
read-bytes-with-partial/macro: Internal macros
read-counted-string: Exported functions
read-enum: Exported functions
read-file: Exported functions
read-float: Exported macros
read-integer: Exported functions
read-octets-to-string: Internal macros
read-partial-byte/big-endian: Internal functions
read-partial-byte/little-endian: Internal functions
read-terminated-string: Exported functions
read/write-binary-type: Internal macros
recursive-find: Exported functions
recursive-find-if: Exported functions
recursive-find-sublist: Exported functions
recursive-find/collect: Exported functions
recursive-map: Exported functions
recursive-mapcar: Exported functions
relative-file-position: Exported functions
remove-all-restart-case: Internal functions
remove-binding: Exported functions
remove-double-multiple-value-bind: Internal functions
remove-impossible-error-checks: Internal functions
remove-plist-keys: Exported functions
reset-op: Internal functions
reverse-bit-stream-groups: Internal functions
reverse-byte: Internal functions
right-pad: Internal functions
runtime-reader/writer-form: Internal functions

S
signed->unsigned: Exported functions
signed->unsigned/bits: Exported functions
simple-array-p: Internal functions
simple-define-condition: Exported macros
split-bit-field: Exported functions
struct-like-defclass: Exported macros
subst*: Exported functions

T
take-while: Internal functions
type-size: Internal functions

U
unsigned->signed: Exported functions
unsigned->signed/bits: Exported functions

V
var-bit-stream: Internal functions
virtual-type-can-be-in-bit-field: Internal functions
virtual-type-estimated-total-bits: Internal functions
virtual-type-lambda-list: Internal functions
virtual-type-lisp-type: Internal functions
virtual-type-name: Internal functions
virtual-type-p: Internal functions
virtual-type-reader: Internal functions
virtual-type-stream-required: Internal functions
virtual-type-writer: Internal functions

W
with-buffered-output: Exported macros
with-file-position: Exported macros
with-letf-bindings: Internal macros
with-local-pointer-resolving-context: Exported macros
with-open-binary-file: Exported macros
with-wrapped-in-bit-stream: Exported macros
with-wrapped-in-reverse-stream: Exported macros
wrap-in-bit-stream: Exported generic functions
wrap-in-bit-stream: Exported generic functions
wrap-in-reverse-stream: Exported generic functions
wrap-in-reverse-stream: Exported generic functions
write-binary: Exported generic functions
write-binary-type: Exported functions
write-bits: Exported functions
write-bytes: Exported generic functions
write-bytes: Exported generic functions
write-bytes: Exported generic functions
write-counted-string: Exported functions
write-enum: Exported functions
write-float: Exported macros
write-integer: Exported functions
write-terminated-string: Exported functions

Jump to:   %   (  
A   B   C   D   E   F   G   I   J   L   M   N   O   P   Q   R   S   T   U   V   W  

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

A.3 Variables

Jump to:   *   +   -  
A   B   C   D   E   I   L   N   O   P   Q   R   S   T   V   W  
Index Entry  Section

*
*8-bit-lookup-table*: Internal special variables
*always-produce-byte-count*: Internal special variables
*base-pointer-tags*: Internal special variables
*byte-order*: Exported special variables
*debug*: Internal special variables
*denormals*: Internal special variables
*enum-definitions*: Internal special variables
*format-table*: Internal special variables
*ignore-eval-type-bitstream-issue*: Internal special variables
*ignore-on-write*: Internal special variables
*known-defbinary-types*: Internal special variables
*last-f*: Internal special variables
*outer-stream-file-position*: Internal special variables
*queued-pointers*: Internal special variables
*type-info-objects*: Internal special variables
*virtual-types*: Internal special variables

+
+inf: Exported special variables

-
-inf: Exported special variables

A
align: Internal classes

B
bad-value: Exported conditions
base-pointer: Exported classes
bind-index-to: Internal classes
bit-stream-id: Internal structures
bits-left: Exported classes
byte-count-name: Internal classes
byte-order: Exported classes
byte-order: Internal structures
byte-order: Internal classes

C
can-be-in-bit-field: Internal structures
closure: Internal structures

D
data-to-store: Internal structures
debug-data: Internal special variables
defbinary-type: Internal special variables
defstruct-field: Internal structures

E
element-align: Internal classes
element-bits: Exported classes
element-bits: Exported classes
enum-name: Exported conditions
estimated-total-bits: Internal structures

I
input-string: Exported conditions
integer-value: Exported conditions

L
lambda-list: Internal structures
last-byte: Exported classes
last-op: Exported classes
lisp-type: Internal structures
lookup-table: Exported classes

N
name: Internal structures
name: Internal structures
name: Internal structures
name: Internal classes

O
offset: Exported classes
offset-byte-order: Internal structures
offset-position: Internal structures
offset-signedness: Internal structures
offset-size/bytes: Internal structures

P
pointer: Exported special variables
previous-defs-symbol: Internal classes

Q
quiet-nan: Exported special variables

R
read-form: Internal structures
reader: Internal structures
reader: Internal classes
real-stream: Exported classes
real-stream: Exported classes
required-value: Exported conditions

S
signalling-nan: Exported special variables
signed: Internal structures
size: Internal structures
Slot, align: Internal classes
Slot, bad-value: Exported conditions
Slot, base-pointer: Exported classes
Slot, bind-index-to: Internal classes
Slot, bit-stream-id: Internal structures
Slot, bits-left: Exported classes
Slot, byte-count-name: Internal classes
Slot, byte-order: Exported classes
Slot, byte-order: Internal structures
Slot, byte-order: Internal classes
Slot, can-be-in-bit-field: Internal structures
Slot, closure: Internal structures
Slot, data-to-store: Internal structures
Slot, defstruct-field: Internal structures
Slot, element-align: Internal classes
Slot, element-bits: Exported classes
Slot, element-bits: Exported classes
Slot, enum-name: Exported conditions
Slot, estimated-total-bits: Internal structures
Slot, input-string: Exported conditions
Slot, integer-value: Exported conditions
Slot, lambda-list: Internal structures
Slot, last-byte: Exported classes
Slot, last-op: Exported classes
Slot, lisp-type: Internal structures
Slot, lookup-table: Exported classes
Slot, name: Internal structures
Slot, name: Internal structures
Slot, name: Internal structures
Slot, name: Internal classes
Slot, offset: Exported classes
Slot, offset-byte-order: Internal structures
Slot, offset-position: Internal structures
Slot, offset-signedness: Internal structures
Slot, offset-size/bytes: Internal structures
Slot, previous-defs-symbol: Internal classes
Slot, read-form: Internal structures
Slot, reader: Internal structures
Slot, reader: Internal classes
Slot, real-stream: Exported classes
Slot, real-stream: Exported classes
Slot, required-value: Exported conditions
Slot, signed: Internal structures
Slot, size: Internal structures
Slot, stream: Exported classes
Slot, stream-required: Internal structures
Slot, stream-symbol: Internal classes
Slot, symbol-value: Exported conditions
Slot, type: Exported classes
Slot, type: Internal structures
Slot, type: Internal classes
Slot, variables: Internal structures
Slot, write-form: Internal structures
Slot, writer: Internal structures
Slot, writer: Internal classes
Special Variable, *8-bit-lookup-table*: Internal special variables
Special Variable, *always-produce-byte-count*: Internal special variables
Special Variable, *base-pointer-tags*: Internal special variables
Special Variable, *byte-order*: Exported special variables
Special Variable, *debug*: Internal special variables
Special Variable, *denormals*: Internal special variables
Special Variable, *enum-definitions*: Internal special variables
Special Variable, *format-table*: Internal special variables
Special Variable, *ignore-eval-type-bitstream-issue*: Internal special variables
Special Variable, *ignore-on-write*: Internal special variables
Special Variable, *known-defbinary-types*: Internal special variables
Special Variable, *last-f*: Internal special variables
Special Variable, *outer-stream-file-position*: Internal special variables
Special Variable, *queued-pointers*: Internal special variables
Special Variable, *type-info-objects*: Internal special variables
Special Variable, *virtual-types*: Internal special variables
Special Variable, +inf: Exported special variables
Special Variable, -inf: Exported special variables
Special Variable, debug-data: Internal special variables
Special Variable, defbinary-type: Internal special variables
Special Variable, pointer: Exported special variables
Special Variable, quiet-nan: Exported special variables
Special Variable, signalling-nan: Exported special variables
stream: Exported classes
stream-required: Internal structures
stream-symbol: Internal classes
symbol-value: Exported conditions

T
type: Exported classes
type: Internal structures
type: Internal classes

V
variables: Internal structures

W
write-form: Internal structures
writer: Internal structures
writer: Internal classes

Jump to:   *   +   -  
A   B   C   D   E   I   L   N   O   P   Q   R   S   T   V   W  

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

A.4 Data types

Jump to:   B   C   D   E   I   L   O   P   R   S   U   V  
Index Entry  Section

B
bad-enum-value: Exported conditions
bad-magic-value: Exported conditions
binary-field: Internal structures
bit-stream: Exported classes

C
Class, bit-stream: Exported classes
Class, defbinary-type: Internal classes
Class, pointer: Exported classes
Class, reverse-stream: Exported classes
Condition, bad-enum-value: Exported conditions
Condition, bad-magic-value: Exported conditions
Condition, input-string-too-long: Exported conditions
Condition, unknown-type-size: Internal conditions
Condition, unspecified-type-error: Internal conditions

D
defbinary-type: Internal classes

E
enum-definition: Internal structures

I
input-string-too-long: Exported conditions

L
lisp-binary: The lisp-binary system
lisp-binary: The lisp-binary package
lisp-binary-utils: The lisp-binary-utils package
lisp-binary/float: The lisp-binary/float package
lisp-binary/integer: The lisp-binary/integer package

O
out-pointer: Internal structures

P
Package, lisp-binary: The lisp-binary package
Package, lisp-binary-utils: The lisp-binary-utils package
Package, lisp-binary/float: The lisp-binary/float package
Package, lisp-binary/integer: The lisp-binary/integer package
Package, reverse-stream: The reverse-stream package
Package, simple-bit-stream: The simple-bit-stream package
pointer: Exported classes

R
reverse-stream: The reverse-stream package
reverse-stream: Exported classes

S
simple-bit-stream: The simple-bit-stream package
Structure, binary-field: Internal structures
Structure, enum-definition: Internal structures
Structure, out-pointer: Internal structures
Structure, virtual-type: Internal structures
System, lisp-binary: The lisp-binary system

U
unknown-type-size: Internal conditions
unspecified-type-error: Internal conditions

V
virtual-type: Internal structures

Jump to:   B   C   D   E   I   L   O   P   R   S   U   V