The cbor Reference Manual

This is the cbor Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:30:52 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cbor

CBOR encoder/decoder

Author

Mihai Bazon <>

License

MIT

Version

0.0.1

Dependencies
  • trivial-utf-8 (system).
  • ieee-floats (system).
  • local-time (system).
  • closer-mop (system).
Source

cbor.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 cbor/cbor.asd

Source

cbor.asd.

Parent Component

cbor (system).

ASDF Systems

cbor.


3.1.2 cbor/package.lisp

Source

cbor.asd.

Parent Component

cbor (system).

Packages

cbor.


3.1.3 cbor/cbor.lisp

Dependency

package.lisp (file).

Source

cbor.asd.

Parent Component

cbor (system).

Public Interface
Internals

3.1.4 cbor/memstream.lisp

Dependency

cbor.lisp (file).

Source

cbor.asd.

Parent Component

cbor (system).

Internals

3.1.5 cbor/encode.lisp

Dependency

memstream.lisp (file).

Source

cbor.asd.

Parent Component

cbor (system).

Public Interface

encode (function).

Internals

3.1.6 cbor/decode.lisp

Dependency

encode.lisp (file).

Source

cbor.asd.

Parent Component

cbor (system).

Public Interface

decode (function).

Internals

4 Packages

Packages are listed by definition order.


4.1 cbor

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Special variables

Special Variable: *array-format*

Bind this to :list if you want arrays to decode as lists. Note that the empty array will be NIL in this case.

Package

cbor.

Source

cbor.lisp.

Special Variable: *custom-tag-reader*

Custom tag reader function, for tags not supported by ‘read-tagged’. Receives tag number and the value.

Package

cbor.

Source

cbor.lisp.

Special Variable: *dictionary-format*

How to decode dictionaries. Supports :HASH, :ALIST or :PLIST. When :HASH (the default), dictionaries are decoded into hash tables using #’EQ as test when *string-to-symbol* is bound, or #’EQUAL otherwise.

Package

cbor.

Source

cbor.lisp.

Special Variable: *jsown-semantics*

Bind this to T if you want encode/decode to use JSOWN’s conventions.

Package

cbor.

Source

cbor.lisp.

Special Variable: *string-to-symbol*

A function that converts strings to symbols. Applied for dictionary name and keys. If bound to NIL while decoding, strings will be left alone.

Package

cbor.

Source

cbor.lisp.

Special Variable: *symbol-to-string*

A function that converts symbols to strings. If bound to NIL while encoding, ‘symbol-name’ will be used instead.

Package

cbor.

Source

cbor.lisp.

Special Variable: *symbols-package*

Package to intern symbols into. Used by the default implementation of ‘*string-to-symbol*’.

Package

cbor.

Source

cbor.lisp.


5.1.2 Ordinary functions

Function: decode (input)
Package

cbor.

Source

decode.lisp.

Function: encode (value)
Package

cbor.

Source

encode.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *buffer-size*
Package

cbor.

Source

memstream.lisp.

Special Variable: *max-uint64*
Package

cbor.

Source

cbor.lisp.

Special Variable: *min-uint64*
Package

cbor.

Source

cbor.lisp.

Special Variable: *optimize*
Package

cbor.

Source

cbor.lisp.


5.2.2 Macros

Macro: unroll-read-byte (size input)
Package

cbor.

Source

decode.lisp.

Macro: unroll-write-byte (size value output)
Package

cbor.

Source

encode.lisp.

Macro: with-dictionary ((output length) &body body)
Package

cbor.

Source

encode.lisp.

Macro: with-ms-position ((stream position) &body body)
Package

cbor.

Source

memstream.lisp.

Macro: with-stream-slots (stream &body body)
Package

cbor.

Source

memstream.lisp.

Macro: with-tag ((_input _tag) &body body)
Package

cbor.

Source

decode.lisp.


5.2.3 Ordinary functions

Function: %decode (input)
Package

cbor.

Source

decode.lisp.

Function: %encode (value output)
Package

cbor.

Source

encode.lisp.

Function: %make-memstream (&key data position size)
Package

cbor.

Source

memstream.lisp.

Function: copy-memstream (instance)
Package

cbor.

Source

memstream.lisp.

Function: decode-float16 (bits)
Package

cbor.

Source

cbor.lisp.

Function: encode-alist (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-array (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-bignum (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-binary (seq output)
Package

cbor.

Source

encode.lisp.

Function: encode-false (output)
Package

cbor.

Source

encode.lisp.

Function: encode-float (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-float16 (float)
Package

cbor.

Source

cbor.lisp.

Function: encode-hash (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-list (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-negative-integer (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-null (output)
Package

cbor.

Source

encode.lisp.

Function: encode-positive-integer (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-string (str output)
Package

cbor.

Source

encode.lisp.

Function: encode-symbol (value output)
Package

cbor.

Source

encode.lisp.

Function: encode-true (output)
Package

cbor.

Source

encode.lisp.

Function: make-memstream (&optional data)
Package

cbor.

Source

memstream.lisp.

Function: memstream-p (object)
Package

cbor.

Source

memstream.lisp.

Reader: ms-data (instance)
Writer: (setf ms-data) (instance)
Package

cbor.

Source

memstream.lisp.

Target Slot

data.

Function: ms-extend-stream (stream &optional min-size)
Package

cbor.

Source

memstream.lisp.

Function: ms-peek-byte (stream)
Package

cbor.

Source

memstream.lisp.

Reader: ms-position (instance)
Writer: (setf ms-position) (instance)
Package

cbor.

Source

memstream.lisp.

Target Slot

position.

Function: ms-read-byte (stream)
Package

cbor.

Source

memstream.lisp.

Function: ms-read-sequence (sequence stream &key start end)
Package

cbor.

Source

memstream.lisp.

Reader: ms-size (instance)
Writer: (setf ms-size) (instance)
Package

cbor.

Source

memstream.lisp.

Target Slot

size.

Function: ms-whole-data (stream)
Package

cbor.

Source

memstream.lisp.

Function: ms-write-byte (byte stream)
Package

cbor.

Source

memstream.lisp.

Function: ms-write-sequence (sequence stream &key start end)
Package

cbor.

Source

memstream.lisp.

Function: read-array (input size &optional indefinite-size)
Package

cbor.

Source

decode.lisp.

Function: read-bignum (input)
Package

cbor.

Source

decode.lisp.

Function: read-binary (input size &optional indefinite-size)
Package

cbor.

Source

decode.lisp.

Function: read-datetime (input)
Package

cbor.

Source

decode.lisp.

Function: read-float (argument)
Package

cbor.

Source

decode.lisp.

Function: read-map (input size &optional indefinite-size)
Package

cbor.

Source

decode.lisp.

Function: read-string (input size &optional indefinite-size)
Package

cbor.

Source

decode.lisp.

Function: read-string-datetime (input)
Package

cbor.

Source

decode.lisp.

Function: read-tagged (input tag)
Package

cbor.

Source

decode.lisp.

Function: write-tag (type argument output)
Package

cbor.

Source

encode.lisp.


5.2.4 Generic functions

Generic Function: encode-object (object output)
Package

cbor.

Source

encode.lisp.

Methods
Method: encode-object ((ts timestamp) (output memstream))
Method: encode-object ((object standard-object) (output memstream))
Method: encode-object ((object structure-object) (output memstream))

5.2.5 Structures

Structure: memstream
Package

cbor.

Source

memstream.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: data
Type

cbor::raw-data

Initform

(make-array cbor::*buffer-size* :element-type (quote (unsigned-byte 8)))

Readers

ms-data.

Writers

(setf ms-data).

Slot: position
Package

common-lisp.

Type

(integer 0 17592186044416)

Initform

0

Readers

ms-position.

Writers

(setf ms-position).

Slot: size
Type

(integer 0 17592186044416)

Initform

0

Readers

ms-size.

Writers

(setf ms-size).


5.2.6 Types

Type: raw-data ()
Package

cbor.

Source

cbor.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
C   D   E   F   G   M   R   U   W  
Index Entry  Section

%
%decode: Private ordinary functions
%encode: Private ordinary functions
%make-memstream: Private ordinary functions

(
(setf ms-data): Private ordinary functions
(setf ms-position): Private ordinary functions
(setf ms-size): Private ordinary functions

C
copy-memstream: Private ordinary functions

D
decode: Public ordinary functions
decode-float16: Private ordinary functions

E
encode: Public ordinary functions
encode-alist: Private ordinary functions
encode-array: Private ordinary functions
encode-bignum: Private ordinary functions
encode-binary: Private ordinary functions
encode-false: Private ordinary functions
encode-float: Private ordinary functions
encode-float16: Private ordinary functions
encode-hash: Private ordinary functions
encode-list: Private ordinary functions
encode-negative-integer: Private ordinary functions
encode-null: Private ordinary functions
encode-object: Private generic functions
encode-object: Private generic functions
encode-object: Private generic functions
encode-object: Private generic functions
encode-positive-integer: Private ordinary functions
encode-string: Private ordinary functions
encode-symbol: Private ordinary functions
encode-true: Private ordinary functions

F
Function, %decode: Private ordinary functions
Function, %encode: Private ordinary functions
Function, %make-memstream: Private ordinary functions
Function, (setf ms-data): Private ordinary functions
Function, (setf ms-position): Private ordinary functions
Function, (setf ms-size): Private ordinary functions
Function, copy-memstream: Private ordinary functions
Function, decode: Public ordinary functions
Function, decode-float16: Private ordinary functions
Function, encode: Public ordinary functions
Function, encode-alist: Private ordinary functions
Function, encode-array: Private ordinary functions
Function, encode-bignum: Private ordinary functions
Function, encode-binary: Private ordinary functions
Function, encode-false: Private ordinary functions
Function, encode-float: Private ordinary functions
Function, encode-float16: Private ordinary functions
Function, encode-hash: Private ordinary functions
Function, encode-list: Private ordinary functions
Function, encode-negative-integer: Private ordinary functions
Function, encode-null: Private ordinary functions
Function, encode-positive-integer: Private ordinary functions
Function, encode-string: Private ordinary functions
Function, encode-symbol: Private ordinary functions
Function, encode-true: Private ordinary functions
Function, make-memstream: Private ordinary functions
Function, memstream-p: Private ordinary functions
Function, ms-data: Private ordinary functions
Function, ms-extend-stream: Private ordinary functions
Function, ms-peek-byte: Private ordinary functions
Function, ms-position: Private ordinary functions
Function, ms-read-byte: Private ordinary functions
Function, ms-read-sequence: Private ordinary functions
Function, ms-size: Private ordinary functions
Function, ms-whole-data: Private ordinary functions
Function, ms-write-byte: Private ordinary functions
Function, ms-write-sequence: Private ordinary functions
Function, read-array: Private ordinary functions
Function, read-bignum: Private ordinary functions
Function, read-binary: Private ordinary functions
Function, read-datetime: Private ordinary functions
Function, read-float: Private ordinary functions
Function, read-map: Private ordinary functions
Function, read-string: Private ordinary functions
Function, read-string-datetime: Private ordinary functions
Function, read-tagged: Private ordinary functions
Function, write-tag: Private ordinary functions

G
Generic Function, encode-object: Private generic functions

M
Macro, unroll-read-byte: Private macros
Macro, unroll-write-byte: Private macros
Macro, with-dictionary: Private macros
Macro, with-ms-position: Private macros
Macro, with-stream-slots: Private macros
Macro, with-tag: Private macros
make-memstream: Private ordinary functions
memstream-p: Private ordinary functions
Method, encode-object: Private generic functions
Method, encode-object: Private generic functions
Method, encode-object: Private generic functions
ms-data: Private ordinary functions
ms-extend-stream: Private ordinary functions
ms-peek-byte: Private ordinary functions
ms-position: Private ordinary functions
ms-read-byte: Private ordinary functions
ms-read-sequence: Private ordinary functions
ms-size: Private ordinary functions
ms-whole-data: Private ordinary functions
ms-write-byte: Private ordinary functions
ms-write-sequence: Private ordinary functions

R
read-array: Private ordinary functions
read-bignum: Private ordinary functions
read-binary: Private ordinary functions
read-datetime: Private ordinary functions
read-float: Private ordinary functions
read-map: Private ordinary functions
read-string: Private ordinary functions
read-string-datetime: Private ordinary functions
read-tagged: Private ordinary functions

U
unroll-read-byte: Private macros
unroll-write-byte: Private macros

W
with-dictionary: Private macros
with-ms-position: Private macros
with-stream-slots: Private macros
with-tag: Private macros
write-tag: Private ordinary functions


A.3 Variables