Common Lisp Package: ODD-STREAMS

README:

FUNCTION

Public

MAKE-ODD-STREAM (STREAM &KEY (BYTE-SIZE 1) BUFFER-SIZE)

Creates and returns a new odd stream. STREAM must be an open binary stream capable of reading/writing octets. The resulting odd stream is an input stream if and only if STREAM is an input stream. Likewise, it's an output stream if and only if STREAM is an output stream. BYTE-SIZE is the size of one stream element in bits, i.e. the stream will (try to) behave as if it had element type (UNSIGNED-BYTE BYTE-SIZE). BUFFER-SIZE is the size of the stream's buffer in octets.

ODD-STREAM-ERROR (FORMAT-CONTROL &REST FORMAT-ARGUMENTS)

Signals an error of type ODD-STREAM-SIMPLE-ERROR with the provided format control and arguments.

Private

SANS (PLIST &REST KEYS)

Returns PLIST with keyword arguments from KEYS removed.

Undocumented

HYPERDOC-LOOKUP (SYMBOL TYPE)

MACRO

Public

WITH-OPEN-ODD-FILE ((STREAM FILESPEC &REST REST &KEY BYTE-SIZE BUFFER-SIZE DIRECTION IF-EXISTS IF-DOES-NOT-EXIST) &BODY BODY)

Like CL:WITH-OPEN-FILE, but for odd streams. See MAKE-ODD-STREAM for the meaning of the parameters.

WITH-OPEN-ODD-STREAM ((VAR STREAM &REST REST &KEY BYTE-SIZE BUFFER-SIZE) &BODY BODY)

Like CL:WITH-OPEN-STREAM, but for odd streams. See MAKE-ODD-STREAM for the meaning of the parameters.

GENERIC-FUNCTION

Public

Undocumented

ODD-FILE-LENGTH (ODD-STREAM)

Private

Undocumented

AT-BUFFER-END-P (STREAM)

AT-BUFFER-LIMIT-P (STREAM)

BITS-AVAILABLE (STREAM)

FILL-BUFFER (STREAM)

FLUSH-BUFFER (STREAM &KEY EVERYTHING RE-POSITION)

MUST-FILL-P (STREAM BITS-WANTED)

ODD-STREAM-OPERATION-NOT-IMPLEMENTED-OPERATION (CONDITION)

ODD-STREAM-OPERATION-NOT-IMPLEMENTED-STREAM (CONDITION)

ODD-STREAM-POSITION-SPEC-ERROR-POSITION-SPEC (CONDITION)

SLOT-ACCESSOR

Public

ODD-STREAM-BUFFER-SIZE (OBJECT)

The size of the stream's buffer in octets.

ODD-STREAM-BYTE-SIZE (OBJECT)

The size of the "apparent element type" of the odd stream in bits, i.e. the stream behaves as if its element type were (UNSIGNED-BYTE BYTE-SIZE).

Private

ODD-STREAM-BIT-POSTION (OBJECT)

The current bit position within the buffer - the actual position is a combination of this value and OCTET-POSITION.

SETFODD-STREAM-BIT-POSTION (NEW-VALUE OBJECT)

The current bit position within the buffer - the actual position is a combination of this value and OCTET-POSITION.

ODD-STREAM-BUFFER (OBJECT)

Odd streams are buffered streams, and this is the buffer - an array of BUFFER-SIZE octets.

ODD-STREAM-BUFFER-BIT-LIMIT (OBJECT)

If this value is not 0 (zero), then the first BUFFER-BIT-LIMIT bits of the buffer element at index BUFFER-OCTET-LIMIT are valid bits of the buffer. This value can only be non-zero for output streams.

SETFODD-STREAM-BUFFER-BIT-LIMIT (NEW-VALUE OBJECT)

If this value is not 0 (zero), then the first BUFFER-BIT-LIMIT bits of the buffer element at index BUFFER-OCTET-LIMIT are valid bits of the buffer. This value can only be non-zero for output streams.

ODD-STREAM-BUFFER-FILE-POSITION (OBJECT)

Where the beginning of the buffer is located within the original stream - measured in octets.

SETFODD-STREAM-BUFFER-FILE-POSITION (NEW-VALUE OBJECT)

Where the beginning of the buffer is located within the original stream - measured in octets.

ODD-STREAM-BUFFER-MODIFIED-P (OBJECT)

A boolean indicating whether the stream's buffer has been modified since it was last flushed.

SETFODD-STREAM-BUFFER-MODIFIED-P (NEW-VALUE OBJECT)

A boolean indicating whether the stream's buffer has been modified since it was last flushed.

ODD-STREAM-BUFFER-OCTET-LIMIT (OBJECT)

The index of the first octet in the buffer which isn't valid anymore - but see BUFFER-BIT-LIMIT.

SETFODD-STREAM-BUFFER-OCTET-LIMIT (NEW-VALUE OBJECT)

The index of the first octet in the buffer which isn't valid anymore - but see BUFFER-BIT-LIMIT.

ODD-STREAM-OCTET-POSTION (OBJECT)

The current octet position within the buffer - the actual position is a combination of this value and BIT-POSITION.

SETFODD-STREAM-OCTET-POSTION (NEW-VALUE OBJECT)

The current octet position within the buffer - the actual position is a combination of this value and BIT-POSITION.

ODD-STREAM-STREAM (OBJECT)

The actual stream that's used for input and/or output - a binary stream with element-type OCTET.

VARIABLE

Private

Undocumented

*HYPERDOC-BASE-URI*

CLASS

Public

ODD-INPUT-STREAM

An ODD-INPUT-STREAM is an ODD-STREAM that can actually be instatiated and used for input. Don't use MAKE-INSTANCE to create a new ODD-INPUT-STREAM but use MAKE-ODD-STREAM instead.

ODD-IO-STREAM

An ODD-IO-STREAM is an ODD-STREAM that can actually be instatiated and used for input and output. Don't use MAKE-INSTANCE to create a new ODD-IO-STREAM but use MAKE-ODD-STREAM instead.

ODD-OUTPUT-STREAM

An ODD-OUTPUT-STREAM is an ODD-STREAM that can actually be instatiated and used for output. Don't use MAKE-INSTANCE to create a new ODD-OUTPUT-STREAM but use MAKE-ODD-STREAM instead.

ODD-STREAM

A ODD-STREAM object is a stream that's `layered' atop an existing binary stream in order to allow for `odd' element types like (UNSIGNED-BYTE 3). Odd streams use a buffer that acts as a "window" into the original stream. Only the part of the buffer from its beginning up to the bit specified by BUFFER-OCTET-LIMIT and BUFFER-BIT-LIMIT is valid. ODD-STREAM itself is a mixin and should not be instantiated.

CONDITION

Public

ODD-STREAM-CONDITION

Superclass for all conditions related to odd streams.

ODD-STREAM-ERROR (FORMAT-CONTROL &REST FORMAT-ARGUMENTS)

Superclass for all errors related to odd streams.

ODD-STREAM-WARNING

Superclass for all warnings related to odd streams.

Private

ODD-STREAM-OPERATION-NOT-IMPLEMENTED

This warning is signalled when an operation (like CLEAR-INPUT for example) is not implemented for an odd stream.

ODD-STREAM-POSITION-SPEC-ERROR

Errors of this type are signaled if an erroneous position spec is used in conjunction with FILE-POSITION.

ODD-STREAM-SIMPLE-ERROR

Like ODD-STREAM-ERROR but with formatting capabilities.

CONSTANT

Private

+MAX-BYTE-SIZE+

The maximal size of an odd stream element in bits.

+MIN-BUFFER-SIZE+

The minimal size for a buffer in octets.