content-length

Content-length is a Library providing a character stream output class which simply discards its input, but maintains a counter of how many characters have been written, suitable for sending in a HTTP Content-Length header. It uses Gray streams.

Class CONTENT-LENGTH:CONTENT-LENGTH-STREAM

Description:

A content-length-stream is an output stream with one slot, a counter of the number of characters sent to the stream so far.

Accessor CONTENT-LENGTH:CONTENT-LENGTH

Syntax:

content-length:content-length stream => length

(setf content-length:content-length stream) new-length

Arguments and Values:

stream - A stream object of type content-length-stream.

length - The number of characters written to the stream.

Description:

Returns the number of characters written to the stream so far.

Function CONTENT-LENGTH:MAKE-CONTENT-LENGTH-STREAM

Syntax:

content-length:make-content-length-stream => stream

Arguments and Values:

stream - A stream object of type content-length-stream.

Description:

Equivalent to (make-instance 'content-length:content-length-stream)

Macro CONTENT-LENGTH:WITH-OUTPUT-CONTENT-LENGTH

Syntax:

content-length:with-output-content-length var &body body => length

Arguments and Values:

var - a variable name.

length - the number of characters written to the stream.

Description:

content-length:with-output-content-length creates a content-length stream, performs a series of operations that may send results to this stream, and then closes the stream. The body is executed as an implicit progn with var bound to a content-length stream. All output to that stream is counted. The stream is automatically closed on exit from content-length:with-output-content-length, no matter whether the exit is normal or abnormal. The content-length stream to which the variable var is bound has dynamic extent; its extent ends when the form is exited. The consequences are undefined if an attempt is made to assign the variable var.

Download ASDF package from http://www.unmutual.info/software/content-length/content-length-current.tar.gz

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively