The cl-octet-streams Reference Manual

Table of Contents

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

The cl-octet-streams Reference Manual

This is the cl-octet-streams Reference Manual, version 1.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:16:55 2018 GMT+0.


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

1 Introduction

#+TITLE: cl-octet-streams

*cl-octet-streams* is a library implementing in-memory octet streams for Common Lisp.
It was inspired by the [[https://github.com/sharplispers/trivial-octet-streams][trivial-octet-streams]] and [[https://github.com/smithzvk/cl-plumbing][cl-plumbing]] libraries.

* Installation

The only dependency is the [[https://common-lisp.net/project/trivial-gray-streams][trivial-gray-streams]] library.

* API
** Input stream

#+BEGIN_SRC lisp
(make-octet-input-stream seq &optional (start 0) end) => stream
#+END_SRC

Return an input stream which will supply the bytes of /seq/ between /start/ and
/end/ in order.

#+BEGIN_SRC lisp
(with-octet-input-stream (var seq &optional (start 0) end) &body body)
#+END_SRC

Within /body/, /var/ is bound to an octet input stream defined by /seq/, /start/
and /end/. The result of the last form of /body/ is returned.

** Output stream

#+BEGIN_SRC lisp
(make-octet-output-stream) => stream
#+END_SRC

Return an output stream which will accumulate all the bytes written to it for
the benefit of the function /get-output-stream-octets/.

#+BEGIN_SRC lisp
(get-output-stream-octets stream) => bytes
#+END_SRC

Return the bytes that were written to an octet output /stream/.

#+BEGIN_SRC lisp
(with-octet-output-stream (var) &body body) => bytes
#+END_SRC

Within /body/, /var/ is bound to an octet output stream. After all the forms in
/body/ have been executed, the bytes that have been written to /var/ (and that
haven't been consumed by a call to /get-output-stream-octets/ within /body/) are
returned.

** Pipe

#+BEGIN_SRC lisp
(make-octet-pipe) => stream
#+END_SRC

Return a stream which will supply the bytes that have been written to it in
order.

#+BEGIN_SRC lisp
(with-octet-pipe (var) &body body)
#+END_SRC

Within /body/, /var/ is bound to an octet pipe. The result of the last form of
/body/ is returned.

** Connected streams

#+BEGIN_SRC lisp
(make-connected-octet-streams) => stream1, stream2
#+END_SRC

Return two streams connected to each other. The bytes written to the first
stream can be read from the second, and the bytes written to the second stream
can be read from the first.

#+BEGIN_SRC lisp
(with-connected-octet-streams (var1 var2) &body body)
#+END_SRC

Within /body/, /var1/ and /var2/ are bound to octet streams connected to each
other. The result of the last form of /body/ is returned.

* Tests

The tests require the [[https://common-lisp.net/project/fiveam][fiveam]] library.

#+BEGIN_SRC lisp
(asdf:test-system "cl-octet-streams")
#+END_SRC


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 cl-octet-streams

Author

Guillaume LE VAILLANT

License

GPL-3

Description

In-memory octet streams

Version

1.0

Dependency

trivial-gray-streams

Source

cl-octet-streams.asd (file)

Component

src (module)


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

3 Modules

Modules are listed depth-first from the system components tree.


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

3.1 cl-octet-streams/src

Parent

cl-octet-streams (system)

Location

src/

Components

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

4 Files

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


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

4.1 Lisp


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

4.1.1 cl-octet-streams.asd

Location

cl-octet-streams.asd

Systems

cl-octet-streams (system)


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

4.1.2 cl-octet-streams/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

octet-streams


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

4.1.3 cl-octet-streams/src/octet-streams.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/octet-streams.lisp

Exported Definitions
Internal Definitions

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

4.1.4 cl-octet-streams/src/octet-pipes.lisp

Dependency

octet-streams.lisp (file)

Parent

src (module)

Location

src/octet-pipes.lisp

Exported Definitions
Internal Definitions

octet-pipe (class)


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

4.1.5 cl-octet-streams/src/connected-octet-streams.lisp

Dependency

octet-pipes.lisp (file)

Parent

src (module)

Location

src/connected-octet-streams.lisp

Exported Definitions

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

5 Packages

Packages are listed by definition order.


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

5.1 octet-streams

Source

package.lisp (file)

Nickname

cl-octet-streams

Use List
Exported Definitions
Internal Definitions

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

6 Definitions

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


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

6.1 Exported definitions


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

6.1.1 Macros

Macro: with-connected-octet-streams (VAR1 VAR2) &body BODY

Within BODY, VAR1 and VAR2 are bound to octet streams connected to each other. The result of the last form of BODY is returned.

Package

octet-streams

Source

connected-octet-streams.lisp (file)

Macro: with-octet-input-stream (VAR SEQ &optional START END) &body BODY

Within BODY, VAR is bound to an octet input stream defined by SEQ, START and END. The result of the last form of BODY is returned.

Package

octet-streams

Source

octet-streams.lisp (file)

Macro: with-octet-output-stream (VAR) &body BODY

Within BODY, VAR is bound to an octet output stream. After all the forms in BODY have been executed, the bytes that have been written to VAR (and that haven’t been consumed by a call to GET-OUTPUT-STREAM-OCTETS within BODY) are returned.

Package

octet-streams

Source

octet-streams.lisp (file)

Macro: with-octet-pipe (VAR) &body BODY

Within BODY, VAR is bound to an octet pipe. The result of the last form of BODY is returned.

Package

octet-streams

Source

octet-pipes.lisp (file)


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

6.1.2 Functions

Function: get-output-stream-octets STREAM

Return the bytes that were written to an octet output STREAM.

Package

octet-streams

Source

octet-streams.lisp (file)

Function: make-connected-octet-streams ()

Return two streams connected to each other. The bytes written to the first stream can be read from the second, and the bytes written to the second stream can be read from the first.

Package

octet-streams

Source

connected-octet-streams.lisp (file)

Function: make-octet-input-stream SEQ &optional START END

Return an input stream which will supply the bytes of SEQ between START and END in order.

Package

octet-streams

Source

octet-streams.lisp (file)

Function: make-octet-output-stream ()

Return an output stream which will accumulate all the bytes written to it for the benefit of the function GET-OUTPUT-STREAM-OCTETS.

Package

octet-streams

Source

octet-streams.lisp (file)

Function: make-octet-pipe ()

Return a stream which will supply the bytes that have been written to it in order.

Package

octet-streams

Source

octet-pipes.lisp (file)


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

6.2 Internal definitions


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

6.2.1 Functions

Function: replace-fast BUFFER1 BUFFER2 START1 END1 START2 END2
Package

octet-streams

Source

octet-streams.lisp (file)


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

6.2.2 Generic functions

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

octet-streams

Methods
Method: octet-stream-buffer (OCTET-STREAM octet-stream)

automatically generated reader method

Source

octet-streams.lisp (file)

Method: (setf octet-stream-buffer) NEW-VALUE (OCTET-STREAM octet-stream)

automatically generated writer method

Source

octet-streams.lisp (file)

Generic Function: octet-stream-buffer-end OBJECT
Generic Function: (setf octet-stream-buffer-end) NEW-VALUE OBJECT
Package

octet-streams

Methods
Method: octet-stream-buffer-end (OCTET-STREAM octet-stream)

automatically generated reader method

Source

octet-streams.lisp (file)

Method: (setf octet-stream-buffer-end) NEW-VALUE (OCTET-STREAM octet-stream)

automatically generated writer method

Source

octet-streams.lisp (file)

Generic Function: octet-stream-buffer-start OBJECT
Generic Function: (setf octet-stream-buffer-start) NEW-VALUE OBJECT
Package

octet-streams

Methods
Method: octet-stream-buffer-start (OCTET-STREAM octet-stream)

automatically generated reader method

Source

octet-streams.lisp (file)

Method: (setf octet-stream-buffer-start) NEW-VALUE (OCTET-STREAM octet-stream)

automatically generated writer method

Source

octet-streams.lisp (file)


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

6.2.3 Classes

Class: octet-input-stream ()
Package

octet-streams

Source

octet-streams.lisp (file)

Direct superclasses
  • fundamental-binary-input-stream (class)
  • octet-stream (class)
Direct subclasses

octet-pipe (class)

Direct methods
  • stream-clear-input (method)
  • stream-read-sequence (method)
  • stream-read-byte (method)
  • stream-listen (method)
Class: octet-output-stream ()
Package

octet-streams

Source

octet-streams.lisp (file)

Direct superclasses
  • fundamental-binary-output-stream (class)
  • octet-stream (class)
Direct methods
  • stream-clear-output (method)
  • stream-write-sequence (method)
  • stream-write-byte (method)
Class: octet-pipe ()
Package

octet-streams

Source

octet-pipes.lisp (file)

Direct superclasses
Direct methods
  • stream-clear-output (method)
  • stream-write-sequence (method)
  • stream-write-byte (method)
Class: octet-stream ()
Package

octet-streams

Source

octet-streams.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: buffer
Type

octet-streams::simple-octet-vector

Initargs

:buffer

Readers

octet-stream-buffer (generic function)

Writers

(setf octet-stream-buffer) (generic function)

Slot: buffer-start
Type

octet-streams::index

Initargs

:buffer-start

Readers

octet-stream-buffer-start (generic function)

Writers

(setf octet-stream-buffer-start) (generic function)

Slot: buffer-end
Type

octet-streams::index

Initargs

:buffer-end

Readers

octet-stream-buffer-end (generic function)

Writers

(setf octet-stream-buffer-end) (generic function)


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

6.2.4 Types

Type: index ()
Package

octet-streams

Source

octet-streams.lisp (file)

Type: simple-octet-vector ()
Package

octet-streams

Source

octet-streams.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   C   F   L   M  
Index Entry  Section

C
cl-octet-streams.asd: The cl-octet-streams<dot>asd file
cl-octet-streams/src: The cl-octet-streams/src module
cl-octet-streams/src/connected-octet-streams.lisp: The cl-octet-streams/src/connected-octet-streams<dot>lisp file
cl-octet-streams/src/octet-pipes.lisp: The cl-octet-streams/src/octet-pipes<dot>lisp file
cl-octet-streams/src/octet-streams.lisp: The cl-octet-streams/src/octet-streams<dot>lisp file
cl-octet-streams/src/package.lisp: The cl-octet-streams/src/package<dot>lisp file

F
File, Lisp, cl-octet-streams.asd: The cl-octet-streams<dot>asd file
File, Lisp, cl-octet-streams/src/connected-octet-streams.lisp: The cl-octet-streams/src/connected-octet-streams<dot>lisp file
File, Lisp, cl-octet-streams/src/octet-pipes.lisp: The cl-octet-streams/src/octet-pipes<dot>lisp file
File, Lisp, cl-octet-streams/src/octet-streams.lisp: The cl-octet-streams/src/octet-streams<dot>lisp file
File, Lisp, cl-octet-streams/src/package.lisp: The cl-octet-streams/src/package<dot>lisp file

L
Lisp File, cl-octet-streams.asd: The cl-octet-streams<dot>asd file
Lisp File, cl-octet-streams/src/connected-octet-streams.lisp: The cl-octet-streams/src/connected-octet-streams<dot>lisp file
Lisp File, cl-octet-streams/src/octet-pipes.lisp: The cl-octet-streams/src/octet-pipes<dot>lisp file
Lisp File, cl-octet-streams/src/octet-streams.lisp: The cl-octet-streams/src/octet-streams<dot>lisp file
Lisp File, cl-octet-streams/src/package.lisp: The cl-octet-streams/src/package<dot>lisp file

M
Module, cl-octet-streams/src: The cl-octet-streams/src module

Jump to:   C   F   L   M  

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

A.2 Functions

Jump to:   (  
F   G   M   O   R   W  
Index Entry  Section

(
(setf octet-stream-buffer): Internal generic functions
(setf octet-stream-buffer): Internal generic functions
(setf octet-stream-buffer-end): Internal generic functions
(setf octet-stream-buffer-end): Internal generic functions
(setf octet-stream-buffer-start): Internal generic functions
(setf octet-stream-buffer-start): Internal generic functions

F
Function, get-output-stream-octets: Exported functions
Function, make-connected-octet-streams: Exported functions
Function, make-octet-input-stream: Exported functions
Function, make-octet-output-stream: Exported functions
Function, make-octet-pipe: Exported functions
Function, replace-fast: Internal functions

G
Generic Function, (setf octet-stream-buffer): Internal generic functions
Generic Function, (setf octet-stream-buffer-end): Internal generic functions
Generic Function, (setf octet-stream-buffer-start): Internal generic functions
Generic Function, octet-stream-buffer: Internal generic functions
Generic Function, octet-stream-buffer-end: Internal generic functions
Generic Function, octet-stream-buffer-start: Internal generic functions
get-output-stream-octets: Exported functions

M
Macro, with-connected-octet-streams: Exported macros
Macro, with-octet-input-stream: Exported macros
Macro, with-octet-output-stream: Exported macros
Macro, with-octet-pipe: Exported macros
make-connected-octet-streams: Exported functions
make-octet-input-stream: Exported functions
make-octet-output-stream: Exported functions
make-octet-pipe: Exported functions
Method, (setf octet-stream-buffer): Internal generic functions
Method, (setf octet-stream-buffer-end): Internal generic functions
Method, (setf octet-stream-buffer-start): Internal generic functions
Method, octet-stream-buffer: Internal generic functions
Method, octet-stream-buffer-end: Internal generic functions
Method, octet-stream-buffer-start: Internal generic functions

O
octet-stream-buffer: Internal generic functions
octet-stream-buffer: Internal generic functions
octet-stream-buffer-end: Internal generic functions
octet-stream-buffer-end: Internal generic functions
octet-stream-buffer-start: Internal generic functions
octet-stream-buffer-start: Internal generic functions

R
replace-fast: Internal functions

W
with-connected-octet-streams: Exported macros
with-octet-input-stream: Exported macros
with-octet-output-stream: Exported macros
with-octet-pipe: Exported macros

Jump to:   (  
F   G   M   O   R   W  

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

A.3 Variables

Jump to:   B   S  
Index Entry  Section

B
buffer: Internal classes
buffer-end: Internal classes
buffer-start: Internal classes

S
Slot, buffer: Internal classes
Slot, buffer-end: Internal classes
Slot, buffer-start: Internal classes

Jump to:   B   S  

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

A.4 Data types

Jump to:   C   I   O   P   S   T  
Index Entry  Section

C
cl-octet-streams: The cl-octet-streams system
Class, octet-input-stream: Internal classes
Class, octet-output-stream: Internal classes
Class, octet-pipe: Internal classes
Class, octet-stream: Internal classes

I
index: Internal types

O
octet-input-stream: Internal classes
octet-output-stream: Internal classes
octet-pipe: Internal classes
octet-stream: Internal classes
octet-streams: The octet-streams package

P
Package, octet-streams: The octet-streams package

S
simple-octet-vector: Internal types
System, cl-octet-streams: The cl-octet-streams system

T
Type, index: Internal types
Type, simple-octet-vector: Internal types

Jump to:   C   I   O   P   S   T