The simpbin Reference Manual

This is the simpbin Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Jul 13 21:58:20 2025 GMT+0.

Table of Contents


1 Systems

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


1.1 simpbin

A common lisp library to store data in a binary format

Author

Francis St-Amour

License

GNU GPLv3

Version

0.0.1

Dependencies
  • alexandria (system).
  • flexi-streams (system).
  • fast-io (system).
  • nibbles (system).
Source

simpbin.asd.

Child Component

simpbin.lisp (file).


2 Files

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


2.1 Lisp


2.1.1 simpbin/simpbin.asd

Source

simpbin.asd.

Parent Component

simpbin (system).

ASDF Systems

simpbin.

Packages

simpbin.asd.


2.1.2 simpbin/simpbin.lisp

Source

simpbin.asd.

Parent Component

simpbin (system).

Packages

simpbin.

Public Interface
Internals

3 Packages

Packages are listed by definition order.


3.1 simpbin.asd

Source

simpbin.asd.

Use List
  • asdf/interface.
  • common-lisp.

3.2 simpbin

Source

simpbin.lisp.

Use List

common-lisp.

Public Interface
Internals

4 Definitions

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


4.1 Public Interface


4.1.1 Macros

Macro: with-input-from-binary-file ((stream filespec &rest options &key if-exists if-does-not-exist external-format) &body body)

Helper macro to open a file with the right element-type for binary input.

Package

simpbin.

Source

simpbin.lisp.

Macro: with-output-to-binary-file ((stream filespec &rest options &key if-exists if-does-not-exist external-format) &body body)

Helper macro to open a file with the right element-type for binary output.

Package

simpbin.

Source

simpbin.lisp.


4.1.2 Ordinary functions

Function: read-binary-string (stream &key encoding)

Read a STRING from STREAM. Use a 32-bits unsigned integer to store the size of the string.

Package

simpbin.

Source

simpbin.lisp.

Function: read-binary-string* (stream &key encoding)

Read a string from STREAM. Use a varint to store the size of the string.

Package

simpbin.

Source

simpbin.lisp.

Function: read-bit-vector (stream)

Read a bit-vector from STREAM.

Package

simpbin.

Source

simpbin.lisp.

Function: read-header (stream)

Read a header from the stream, verifies the signature and returns the variant number.

Package

simpbin.

Source

simpbin.lisp.

Function: read-integer (stream)

Read a 32 bit, little-endian unsigned INTEGER from STREAM.

Package

simpbin.

Source

simpbin.lisp.

Function: read-octets (stream)

Read an OCTET-VECTOR from STREAM.
Read the length of the vector first, then the content.
Use a 32-bits unsigned integer to store the size of the vector.

Package

simpbin.

Source

simpbin.lisp.

Function: read-octets* (stream)

Read an OCTET-VECTOR to STREAM.
Read the length of the vector first, then the content. Use a varint to store the size of the vector.

Package

simpbin.

Source

simpbin.lisp.

Function: read-varint (stream)

Read a varint-encoded integer from STREAM.

Package

simpbin.

Source

simpbin.lisp.

Function: write-binary-string (string stream &key encoding)

Write a STRING to STREAM. Use a 32-bits unsigned integer to store the size of the string.

Package

simpbin.

Source

simpbin.lisp.

Function: write-binary-string* (string stream &key encoding)

Write a STRING to STREAM. Use a varint to store the size of the string.

Package

simpbin.

Source

simpbin.lisp.

Function: write-bit-vector (bit-vector stream)

Write a BIT-VECTOR to STREAM.
The vector is written in 32-bit chunks, padding is added if necessary. Use varint to store the size, in number of bits, of the bit-vector.

Package

simpbin.

Source

simpbin.lisp.

Function: write-header (stream &optional variant)

Write a header to the stream

Package

simpbin.

Source

simpbin.lisp.

Function: write-integer (integer stream)

Write a 32 bit, little-endian unsigned INTEGER to STREAM.

Package

simpbin.

Source

simpbin.lisp.

Function: write-octets (octet-vector stream)

Write an OCTET-VECTOR to STREAM.
First the size is written, then the content of the vector. Use a 32-bits unsigned integer to store the size of the vector.

Package

simpbin.

Source

simpbin.lisp.

Function: write-octets* (octet-vector stream)

Write an OCTET-VECTOR to STREAM.
First the size is written, then the content of the vector. Use a varint to store the size of the vector.

Package

simpbin.

Source

simpbin.lisp.

Function: write-varint (integer stream)

Write the unsigned INTEGER to STREAM as a varint.

Package

simpbin.

Source

simpbin.lisp.


4.2 Internals


4.2.1 Constants

Constant: +integer-length+

Number of bits read and writen by ‘read-integer’ and ‘write-integer’.

Package

simpbin.

Source

simpbin.lisp.


4.2.2 Ordinary functions

Function: varint-length (integer)

How many octets is needed to encode the unsigned INTEGER as a varint?

Package

simpbin.

Source

simpbin.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   F   M   R   V   W  
Index Entry  Section

F
Function, read-binary-string: Public ordinary functions
Function, read-binary-string*: Public ordinary functions
Function, read-bit-vector: Public ordinary functions
Function, read-header: Public ordinary functions
Function, read-integer: Public ordinary functions
Function, read-octets: Public ordinary functions
Function, read-octets*: Public ordinary functions
Function, read-varint: Public ordinary functions
Function, varint-length: Private ordinary functions
Function, write-binary-string: Public ordinary functions
Function, write-binary-string*: Public ordinary functions
Function, write-bit-vector: Public ordinary functions
Function, write-header: Public ordinary functions
Function, write-integer: Public ordinary functions
Function, write-octets: Public ordinary functions
Function, write-octets*: Public ordinary functions
Function, write-varint: Public ordinary functions

M
Macro, with-input-from-binary-file: Public macros
Macro, with-output-to-binary-file: Public macros

R
read-binary-string: Public ordinary functions
read-binary-string*: Public ordinary functions
read-bit-vector: Public ordinary functions
read-header: Public ordinary functions
read-integer: Public ordinary functions
read-octets: Public ordinary functions
read-octets*: Public ordinary functions
read-varint: Public ordinary functions

V
varint-length: Private ordinary functions

W
with-input-from-binary-file: Public macros
with-output-to-binary-file: Public macros
write-binary-string: Public ordinary functions
write-binary-string*: Public ordinary functions
write-bit-vector: Public ordinary functions
write-header: Public ordinary functions
write-integer: Public ordinary functions
write-octets: Public ordinary functions
write-octets*: Public ordinary functions
write-varint: Public ordinary functions


A.3 Variables

Jump to:   +  
C  
Index Entry  Section

+
+integer-length+: Private constants

C
Constant, +integer-length+: Private constants