This is the utilities.binary-dump Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 08:00:57 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
utilities.binary-dump
Formatting of binary data similar to the od(1) UNIX program.
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
LLGPLv3
0.1.0
alexandria
(system).
let-plus
(system).
nibbles
(system).
src
(module).
readme.org
(file).
Modules are listed depth-first from the system components tree.
utilities.binary-dump/src
utilities.binary-dump
(system).
package.lisp
(file).
util.lisp
(file).
access.lisp
(file).
formatting.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
utilities.binary-dump/utilities.binary-dump.asd
utilities.binary-dump/src/package.lisp
utilities.binary-dump/src/util.lisp
utilities.binary-dump/src/access.lisp
utilities.binary-dump/src/formatting.lisp
utilities.binary-dump/utilities.binary-dump.asd
utilities.binary-dump
(system).
utilities.binary-dump/src/util.lisp
package.lisp
(file).
src
(module).
%stream-remaining-columns
(function).
utilities.binary-dump/src/access.lisp
util.lisp
(file).
src
(module).
map-chunks
(function).
map-units
(function).
*unit-accessors*
(special variable).
find-unit-accessor
(function).
find-unit-accessor/no-cache
(function).
utilities.binary-dump/src/formatting.lisp
access.lisp
(file).
src
(module).
binary-dump
(function).
print-binary-dump
(function).
%binary-dump
(function).
*unit-formatters*
(special variable).
ensure-unit-formatter
(function).
find-unit-formatter
(function).
(setf find-unit-formatter)
(function).
make-unit-formatter
(function).
numeric-part-width
(function).
print-chunk/numeric
(function).
print-chunk/string
(function).
Packages are listed by definition order.
utilities.binary-dump
This package contains functions for printing binary data.
The formatting possibilities resemble some of the ways supported
by the od(1) UNIX program.
The functions ‘binary-dump’ and ‘print-binary-dump’ constitute the API. The former is intended to be called directly while the latter is intended for use in ~/ ‘cl:format’ directives.
alexandria
.
common-lisp
.
let-plus
.
nibbles
.
binary-dump
(function).
map-chunks
(function).
map-units
(function).
print-binary-dump
(function).
%binary-dump
(function).
%stream-remaining-columns
(function).
*unit-accessors*
(special variable).
*unit-formatters*
(special variable).
ensure-unit-formatter
(function).
find-unit-accessor
(function).
find-unit-accessor/no-cache
(function).
find-unit-formatter
(function).
(setf find-unit-formatter)
(function).
make-unit-formatter
(function).
numeric-part-width
(function).
print-chunk/numeric
(function).
print-chunk/string
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Print DATA to STREAM as a binary, octal, decimal, hexadecimal,
etc. dump of the form
[HEADER]
[OFFSET ]B₁ B₂ B₃ ... S₁S₂S₃ ...
...
where OFFSET - the offset of B₁ printed in base OFFSET-BASE - is only printed when OFFSET-BASE is an integer designating a base.
B₁, B₂, ... are the bytes (or larger units according to LENGTH) of
DATA printed in base BASE. LENGTH, ENDIAN and TYPE characterize the
length, type and decoding of units:
LENGTH is either 8, 16, 32 or 64 if TYPE is [UN]SIGNED-BYTE and
either 32 or 64 if TYPE is FLOAT.
ENDIAN is either :LITTLE or :BIG and only matters if LENGTH is
not 8.
TYPE is one of [UN]SIGNED-BYTE and FLOAT.
The default behavior is formatting unsigned byte units in base
*PRINT-BASE*.
S₁S₂... is the part of DATA which corresponds to B₁ B₂ ... rendered
as a string. In S₁S₂..., unprintable and whitespace characters are
replaced with ".".
Return four values: 1) DATA 2) the start index of the processed
sub-sequence of DATA (i.e. START) 3) the corresponding end
index (not necessarily END) 4) the number of processed chunks.
If START and/or END are supplied, the subsequence of DATA bounded
by START and END instead of all of DATA is processed.
Additionally, if LINES is non-nil (either the keyword argument is supplied or its default value, the value of ‘*print-lines*’ is non-nil), the output is limited to LINES lines. Supplying :lines nil removes this limitation, even if ‘*print-lines*’ is non-nil.
When PRINT-TYPE is true, the output is preceded by a line of the
form
N-byte TYPE
where TYPE is the type of DATA.
Depending on the length of DATA and WIDTH, the printed representation can span multiple lines.
Call FUNCTION with subsequent chunks of CHUNK-LENGTH octets of DATA.
Return four values: 1) DATA 2) the start index of the processed
sub-sequence of DATA (i.e. START) 3) the corresponding end
index (not necessarily END) 4) the number of processed chunks.
FUNCTION has to have a lambda-list compatible to the following one:
(offset data start end last-chunk?)
where
* OFFSET is the offset in octets of the current chunk relative to
the beginning of DATA.
* DATA passed through unmodified.
* START and END are the offset in octets of the beginning and end
of the current chunk relative to the beginning of DATA
respectively.
* LAST-CHUNK? is true when the current chunk is the last in DATA.
The last chunk may be shorter than CHUNK-LENGTH.
When supplied, START and/or END select a subsequence of DATA for processing.
Call FUNCTION on subsequent "units" in DATA, return DATA.
Units are subsequences characterized by and interpreted according
to LENGTH, ENDIAN and TYPE:
* LENGTH specifies the number of bits in each unit. Must be 8, 16,
32 or 64 if TYPE is [un]signed-byte and 32 or 64 if TYPE is
‘float’.
* ENDIAN specifies the endianess for the interpretation of the
unit. Possible values: the keywords ‘:little’ and ‘:big’.
* TYPE specifies the type for the interpretation of the
unit. Possible value: the symbols ‘unsigned-byte’, ‘signed-byte’
and ‘float’
Print DATA to STREAM as a binary, octal, decimal, hexadecimal,
etc. dump of the form
[HEADER]
[OFFSET ]B₁ B₂ B₃ ... S₁S₂S₃ ...
...
COLON? controls whether the offset column is printed (the corresponding ‘binary-dump’ keyword parameter is ‘offset-base’).
AT? controls whether the header is printed (the corresponding
‘binary-dump’ keyword parameter is ‘print-type’).
WIDTH specifies the maximum number of columns a line of output
should occupy.
START and END can be used to restrict processing to a subsequence
of DATA.
BASE controls the radix in which numbers in the offset column (if
any) and the numeric data columns are printed.
For more details, see ‘binary-dump’.
This function is designed for use in ~/ format directives.
Jump to: | %
(
B E F M N P |
---|
Jump to: | %
(
B E F M N P |
---|
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Jump to: | A F M P R S U |
---|
Jump to: | A F M P R S U |
---|