The circular-streams Reference Manual

Table of Contents

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

The circular-streams Reference Manual

This is the circular-streams Reference Manual, version 0.1, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:05:55 2018 GMT+0.


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

1 Introduction

Circular-Streams - Circularly readable streams for Common Lisp

Build Status Coverage Status

Usage

(defparameter *stream*
              (flex:make-in-memory-input-stream
               #(72 101 108 108 111)))

(defparameter *circular-stream*
              (make-circular-stream *stream*))

(read-char *circular-stream*)          ;=> #\H
(read-char *circular-stream*)          ;=> #\e
(read-char *circular-stream*)          ;=> #\l
(read-char *circular-stream*)          ;=> #\l
(read-char *circular-stream*)          ;=> #\o
(read-char *circular-stream* nil :eof) ;=> :eof

(let ((buf (make-array 5 :adjustable t :fill-pointer 5)))
  (read-sequence buf *circular-stream*)
  (flex:octets-to-string buf))
;=> "Hello"

Description

Circular-Streams allows you to read streams circularly by wrapping real streams. Once you reach end-of-file of a stream, it's file position will be reset to 0 and you're able to read it again.

Note this library can treat only octet streams which has a method read-byte. This might be expanded in the future.

This library was originally written by Tomohiro Matsuyama as a part of Clack, Eitaro Fukamachi ported it with some improvements.

API Reference

[Class] circular-input-stream

Class for circular input streams. make-circular-input-stream is available to create an instance.

[Function] make-circular-stream

Creates circular-input-stream and returns it.

Author

Copyright

Copyright (c) 2011-2012 Tomohiro Matsuyama (tomo@cx4a.org)
Copyright (c) 2012-2016 Eitaro Fukamachi (e.arrows@gmail.com)

License

Licensed under the LLGPL License.

See Also


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 circular-streams

Author

Tomohiro Matsuyama

License

LLGPL

Description

Circularly readable streams for Common Lisp

Long Description

# Circular-Streams - Circularly readable streams for Common Lisp

[![Build Status](https://travis-ci.org/fukamachi/circular-streams.svg?branch=master)](https://travis-ci.org/fukamachi/circular-streams)
[![Coverage Status](https://coveralls.io/repos/github/fukamachi/circular-streams/badge.svg?branch=master)](https://coveralls.io/github/fukamachi/circular-streams?branch=master)

## Usage

(defparameter *stream*
(flex:make-in-memory-input-stream
#(72 101 108 108 111)))

(defparameter *circular-stream*
(make-circular-stream *stream*))

(read-char *circular-stream*) ;=> #\H
(read-char *circular-stream*) ;=> #\e
(read-char *circular-stream*) ;=> #\l
(read-char *circular-stream*) ;=> #\l
(read-char *circular-stream*) ;=> #\o
(read-char *circular-stream* nil :eof) ;=> :eof

(let ((buf (make-array 5 :adjustable t :fill-pointer 5)))
(read-sequence buf *circular-stream*)
(flex:octets-to-string buf))
;=> "Hello"

## Description

Circular-Streams allows you to read streams circularly by wrapping real streams. Once you reach end-of-file of a stream, it’s file position will be reset to 0 and you’re able to read it again.

Note this library can treat only octet streams which has a method ‘read-byte‘. This might be expanded in the future.

This library was originally written by Tomohiro Matsuyama as a part of [Clack](http://clacklisp.org), Eitaro Fukamachi ported it with some improvements.

## API Reference

### [Class] circular-input-stream

Class for circular input streams. ‘make-circular-input-stream‘ is available to create an instance.

### [Function] make-circular-stream

Creates ‘circular-input-stream‘ and returns it.

## Author

* Tomohiro Matsuyama (tomo@cx4a.org)
* Eitaro Fukamachi (e.arrows@gmail.com)

## Copyright

Copyright (c) 2011-2012 Tomohiro Matsuyama (tomo@cx4a.org)
Copyright (c) 2012-2016 Eitaro Fukamachi (e.arrows@gmail.com)

# License

Licensed under the LLGPL License.

# See Also

* [Gray streams](http://www.cliki.net/Gray%20streams)
* [trivial-gray-streams](http://www.cliki.net/trivial-gray-streams)

Version

0.1

Dependencies
Source

circular-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 circular-streams/src

Parent

circular-streams (system)

Location

src/

Component

circular-streams.lisp (file)


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 circular-streams.asd

Location

circular-streams.asd

Systems

circular-streams (system)

Packages

circular-streams-asd


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

4.1.2 circular-streams/src/circular-streams.lisp

Parent

src (module)

Location

src/circular-streams.lisp

Packages

circular-streams

Exported Definitions
Internal Definitions

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

5 Packages

Packages are listed by definition order.


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

5.1 circular-streams-asd

Source

circular-streams.asd

Use List

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

5.2 circular-streams

Source

circular-streams.lisp (file)

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 Functions

Function: make-circular-input-stream STREAM &key BUFFER

Creates ‘circular-input-stream’ and returns it. If ‘:buffer’ is specified, the instance uses it as an internal buffer. You need this to reuse ‘circular-input-stream’ without saving itself.

Package

circular-streams

Source

circular-streams.lisp (file)

Function: make-circular-stream STREAM &key BUFFER

Creates ‘circular-input-stream’ and returns it. If ‘:buffer’ is specified, the instance uses it as an internal buffer. You need this to reuse ‘circular-input-stream’ without saving itself.

Package

circular-streams

Source

circular-streams.lisp (file)


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

6.1.2 Generic functions

Generic Function: circular-stream-buffer OBJECT
Package

circular-streams

Methods
Method: circular-stream-buffer (CIRCULAR-INPUT-STREAM circular-input-stream)

automatically generated reader method

Source

circular-streams.lisp (file)

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

circular-streams

Methods
Method: circular-stream-position (CIRCULAR-INPUT-STREAM circular-input-stream)

automatically generated reader method

Source

circular-streams.lisp (file)

Method: (setf circular-stream-position) NEW-VALUE (CIRCULAR-INPUT-STREAM circular-input-stream)

automatically generated writer method

Source

circular-streams.lisp (file)

Generic Function: circular-stream-stream OBJECT
Package

circular-streams

Methods
Method: circular-stream-stream (CIRCULAR-INPUT-STREAM circular-input-stream)

automatically generated reader method

Source

circular-streams.lisp (file)


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

6.1.3 Classes

Class: circular-input-stream ()

Class for circular input streams.

Package

circular-streams

Source

circular-streams.lisp (file)

Direct superclasses
  • fundamental-binary-input-stream (class)
  • trivial-gray-stream-mixin (class)
Direct methods
  • stream-file-position (method)
  • stream-file-position (method)
  • stream-read-sequence (method)
  • stream-listen (method)
  • stream-read-line (method)
  • stream-read-char (method)
  • stream-read-byte (method)
  • stream-element-type (method)
  • circular-stream-position (method)
  • circular-stream-position (method)
  • circular-stream-buffer (method)
  • circular-stream-stream (method)
Direct slots
Slot: stream
Initargs

:stream

Readers

circular-stream-stream (generic function)

Slot: buffer
Initargs

:buffer

Initform

(fast-io:make-output-buffer)

Readers

circular-stream-buffer (generic function)

Slot: position
Initform

0

Readers

circular-stream-position (generic function)

Writers

(setf circular-stream-position) (generic function)


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

6.2 Internal definitions


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

6.2.1 Functions

Function: extend-buffer STREAM COUNT
Package

circular-streams

Source

circular-streams.lisp (file)

Function: extend-buffer-one STREAM
Package

circular-streams

Source

circular-streams.lisp (file)

Function: fast-buffer-aref BUFFER INDEX
Package

circular-streams

Source

circular-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
circular-streams.asd: The circular-streams<dot>asd file
circular-streams/src: The circular-streams/src module
circular-streams/src/circular-streams.lisp: The circular-streams/src/circular-streams<dot>lisp file

F
File, Lisp, circular-streams.asd: The circular-streams<dot>asd file
File, Lisp, circular-streams/src/circular-streams.lisp: The circular-streams/src/circular-streams<dot>lisp file

L
Lisp File, circular-streams.asd: The circular-streams<dot>asd file
Lisp File, circular-streams/src/circular-streams.lisp: The circular-streams/src/circular-streams<dot>lisp file

M
Module, circular-streams/src: The circular-streams/src module

Jump to:   C   F   L   M  

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

A.2 Functions

Jump to:   (  
C   E   F   G   M  
Index Entry  Section

(
(setf circular-stream-position): Exported generic functions
(setf circular-stream-position): Exported generic functions

C
circular-stream-buffer: Exported generic functions
circular-stream-buffer: Exported generic functions
circular-stream-position: Exported generic functions
circular-stream-position: Exported generic functions
circular-stream-stream: Exported generic functions
circular-stream-stream: Exported generic functions

E
extend-buffer: Internal functions
extend-buffer-one: Internal functions

F
fast-buffer-aref: Internal functions
Function, extend-buffer: Internal functions
Function, extend-buffer-one: Internal functions
Function, fast-buffer-aref: Internal functions
Function, make-circular-input-stream: Exported functions
Function, make-circular-stream: Exported functions

G
Generic Function, (setf circular-stream-position): Exported generic functions
Generic Function, circular-stream-buffer: Exported generic functions
Generic Function, circular-stream-position: Exported generic functions
Generic Function, circular-stream-stream: Exported generic functions

M
make-circular-input-stream: Exported functions
make-circular-stream: Exported functions
Method, (setf circular-stream-position): Exported generic functions
Method, circular-stream-buffer: Exported generic functions
Method, circular-stream-position: Exported generic functions
Method, circular-stream-stream: Exported generic functions

Jump to:   (  
C   E   F   G   M  

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

A.3 Variables

Jump to:   B   P   S  
Index Entry  Section

B
buffer: Exported classes

P
position: Exported classes

S
Slot, buffer: Exported classes
Slot, position: Exported classes
Slot, stream: Exported classes
stream: Exported classes

Jump to:   B   P   S  

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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
circular-input-stream: Exported classes
circular-streams: The circular-streams system
circular-streams: The circular-streams package
circular-streams-asd: The circular-streams-asd package
Class, circular-input-stream: Exported classes

P
Package, circular-streams: The circular-streams package
Package, circular-streams-asd: The circular-streams-asd package

S
System, circular-streams: The circular-streams system

Jump to:   C   P   S