This is the chunga Reference Manual, version 1.1.8, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:39:23 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
chunga
BSD
1.1.8
trivial-gray-streams
(system).
packages.lisp
(file).
specials.lisp
(file).
util.lisp
(file).
known-words.lisp
(file).
conditions.lisp
(file).
read.lisp
(file).
streams.lisp
(file).
input.lisp
(file).
output.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
chunga/chunga.asd
chunga/packages.lisp
chunga/specials.lisp
chunga/util.lisp
chunga/known-words.lisp
chunga/conditions.lisp
chunga/read.lisp
chunga/streams.lisp
chunga/input.lisp
chunga/output.lisp
chunga/specials.lisp
packages.lisp
(file).
chunga
(system).
*accept-bogus-eols*
(special variable).
*current-error-message*
(special variable).
*treat-semicolon-as-continuation*
(special variable).
*char-buffer*
(special variable).
*current-error-function*
(special variable).
*hyperdoc-base-uri*
(special variable).
+crlf+
(constant).
+hex-digits+
(constant).
+output-buffer-size+
(constant).
define-constant
(macro).
hyperdoc-lookup
(function).
chunga/util.lisp
specials.lisp
(file).
chunga
(system).
peek-char*
(function).
read-char*
(function).
with-character-stream-semantics
(macro).
ends-with-p
(function).
make-keyword
(function).
unread-char*
(function).
when-let
(macro).
chunga/known-words.lisp
util.lisp
(file).
chunga
(system).
as-capitalized-string
(function).
as-keyword
(function).
+keyword-to-string-hash+
(constant).
+known-words+
(constant).
+string-to-keyword-hash+
(constant).
chunga/conditions.lisp
known-words.lisp
(file).
chunga
(system).
chunga-error
(condition).
chunga-warning
(condition).
input-chunking-body-corrupted
(condition).
input-chunking-unexpected-end-of-file
(condition).
syntax-error
(condition).
chunga-condition
(condition).
chunga-simple-error
(condition).
chunga-simple-warning
(condition).
parameter-error
(condition).
chunga/read.lisp
conditions.lisp
(file).
chunga
(system).
assert-char
(function).
read-http-headers
(function).
read-line*
(function).
read-name-value-pair
(function).
read-name-value-pairs
(function).
read-token
(function).
skip-whitespace
(function).
token-char-p
(function).
trim-whitespace
(function).
assert-crlf
(function).
charp
(function).
controlp
(function).
read-cookie-value
(function).
read-quoted-string
(function).
separatorp
(function).
signal-unexpected-chars
(function).
whitespacep
(function).
chunga/streams.lisp
read.lisp
(file).
chunga
(system).
chunked-input-stream
(class).
chunked-input-stream-eof-after-last-chunk
(reader method).
(setf chunked-input-stream-eof-after-last-chunk)
(writer method).
chunked-input-stream-extensions
(reader method).
chunked-input-stream-trailers
(reader method).
chunked-io-stream
(class).
chunked-output-stream
(class).
chunked-stream
(class).
chunked-stream-input-chunking-p
(reader method).
chunked-stream-output-chunking-p
(reader method).
chunked-stream-stream
(reader method).
close
(method).
make-chunked-stream
(function).
open-stream-p
(method).
stream-element-type
(method).
chunked-stream-input-index
(reader method).
(setf chunked-stream-input-index)
(writer method).
chunked-stream-input-limit
(reader method).
(setf chunked-stream-input-limit)
(writer method).
expecting-crlf-p
(reader method).
(setf expecting-crlf-p)
(writer method).
output-buffer
(reader method).
(setf output-buffer)
(writer method).
output-index
(reader method).
(setf output-index)
(writer method).
chunga/input.lisp
streams.lisp
(file).
chunga
(system).
chunked-input-stream-extensions
(method).
chunked-input-stream-trailers
(method).
chunked-stream-input-chunking-p
(method).
(setf chunked-stream-input-chunking-p)
(method).
stream-clear-input
(method).
stream-listen
(method).
stream-read-byte
(method).
stream-read-sequence
(method).
chunked-input-available-p
(method).
fill-buffer
(method).
chunga/output.lisp
input.lisp
(file).
chunga
(system).
chunked-stream-output-chunking-p
(method).
(setf chunked-stream-output-chunking-p)
(method).
close
(method).
stream-clear-output
(method).
stream-finish-output
(method).
stream-force-output
(method).
stream-write-byte
(method).
stream-write-sequence
(method).
flush-buffer
(method).
write-chunk
(method).
Packages are listed by definition order.
chunga
common-lisp
.
trivial-gray-streams
.
*accept-bogus-eols*
(special variable).
*current-error-message*
(special variable).
*treat-semicolon-as-continuation*
(special variable).
as-capitalized-string
(function).
as-keyword
(function).
assert-char
(function).
chunga-error
(condition).
chunga-warning
(condition).
chunked-input-stream
(class).
chunked-input-stream-eof-after-last-chunk
(generic reader).
(setf chunked-input-stream-eof-after-last-chunk)
(generic writer).
chunked-input-stream-extensions
(generic function).
chunked-input-stream-trailers
(generic function).
chunked-io-stream
(class).
chunked-output-stream
(class).
chunked-stream
(class).
chunked-stream-input-chunking-p
(generic function).
(setf chunked-stream-input-chunking-p)
(generic function).
chunked-stream-output-chunking-p
(generic function).
(setf chunked-stream-output-chunking-p)
(generic function).
chunked-stream-stream
(generic reader).
input-chunking-body-corrupted
(condition).
input-chunking-unexpected-end-of-file
(condition).
make-chunked-stream
(function).
peek-char*
(function).
read-char*
(function).
read-http-headers
(function).
read-line*
(function).
read-name-value-pair
(function).
read-name-value-pairs
(function).
read-token
(function).
skip-whitespace
(function).
syntax-error
(condition).
token-char-p
(function).
trim-whitespace
(function).
with-character-stream-semantics
(macro).
*char-buffer*
(special variable).
*current-error-function*
(special variable).
*hyperdoc-base-uri*
(special variable).
+crlf+
(constant).
+hex-digits+
(constant).
+keyword-to-string-hash+
(constant).
+known-words+
(constant).
+output-buffer-size+
(constant).
+string-to-keyword-hash+
(constant).
assert-crlf
(function).
charp
(function).
chunga-condition
(condition).
chunga-simple-error
(condition).
chunga-simple-warning
(condition).
chunked-input-available-p
(generic function).
chunked-stream-input-index
(generic reader).
(setf chunked-stream-input-index)
(generic writer).
chunked-stream-input-limit
(generic reader).
(setf chunked-stream-input-limit)
(generic writer).
controlp
(function).
define-constant
(macro).
ends-with-p
(function).
expecting-crlf-p
(generic reader).
(setf expecting-crlf-p)
(generic writer).
fill-buffer
(generic function).
flush-buffer
(generic function).
hyperdoc-lookup
(function).
make-keyword
(function).
output-buffer
(generic reader).
(setf output-buffer)
(generic writer).
output-index
(generic reader).
(setf output-index)
(generic writer).
parameter-error
(condition).
read-cookie-value
(function).
read-quoted-string
(function).
separatorp
(function).
signal-unexpected-chars
(function).
unread-char*
(function).
when-let
(macro).
whitespacep
(function).
write-chunk
(generic function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Some web servers do not respond with a correct CRLF line ending for HTTP headers but with a lone linefeed or carriage return instead. If this variable is bound to a true value, READ-LINE* will treat a lone LF or CR character as an acceptable end of line. The initial value is NIL.
Used by the parsing functions in ‘read.lisp’ as an introduction to a standardized error message about unexpected characters unless it is NIL.
According to John Foderaro, Netscape v3 web servers bogusly split Set-Cookie headers over multiple lines which means that we’d have to treat Set-Cookie headers ending with a semicolon as incomplete and combine them with the next header. This will only be done if this variable has a true value, though.
Binds *CHAR-BUFFER* around BODY so that within BODY we can use READ-CHAR* and friends (see above) to simulate a character stream although we’re reading from a binary stream.
Kind of the inverse of AS-KEYWORD. Has essentially the same effect as STRING-CAPITALIZE but is optimized for "known" keywords like :CONTENT-LENGTH or :GET.
Converts the string STRING to a keyword where all characters are uppercase or lowercase, taking into account the current readtable case. Might destructively modify STRING if DESTRUCTIVEP is true which is the default. "Knows" several HTTP header names and methods and is optimized to not call INTERN for these.
Reads the next character from STREAM and checks if it is the character EXPECTED-CHAR. Signals an error otherwise.
Creates and returns a chunked stream (a stream of type CHUNKED-STREAM) which wraps STREAM. STREAM must be an open binary stream.
We’re simulating PEEK-CHAR by reading a character and putting it into *CHAR-BUFFER*.
The streams we’re dealing with are all binary with element type (UNSIGNED-BYTE 8) and we’re only interested in ISO-8859-1, so we use this to ‘simulate’ READ-CHAR.
Reads HTTP header lines from STREAM (except for the initial status line which is supposed to be read already) and returns a corresponding alist of names and values where the names are keywords and the values are strings. Multiple lines with the same name are combined into one value, the individual values separated by commas. Header lines which are spread across multiple lines are recognized and treated correctly. Additonally logs the header lines to LOG-STREAM if it is not NIL.
Reads and assembles characters from the binary stream STREAM until a carriage return is read. Makes sure that the following character is a linefeed. If *ACCEPT-BOGUS-EOLS* is not NIL, then the function will also accept a lone carriage return or linefeed as an acceptable line break. Returns the string of characters read excluding the line break. Returns NIL if input ends before one character was read. Additionally logs this string to LOG-STREAM if it is not NIL.
Reads a typical (in RFC 2616) name/value or attribute/value combination from STREAM - a token followed by a #\= character and another token or a quoted string. Returns a cons of name and value, both as strings. If VALUE-REQUIRED-P is NIL, the #\= sign and the value are optional. If COOKIE-SYNTAX is true, uses READ-COOKIE-VALUE internally.
Uses READ-NAME-VALUE-PAIR to read and return an alist of name/value pairs from STREAM. It is assumed that the pairs are separated by semicolons and that the first char read (except for whitespace) will be a semicolon. The parameters are used as in READ-NAME-VALUE-PAIR. Stops reading in case of END-OF-FILE (instead of signaling an error).
Read characters from STREAM while they are token constituents (according to RFC 2616). It is assumed that there’s a token character at the current position. The token read is returned as a string. Doesn’t signal an error (but simply stops reading) if END-OF-FILE is encountered after the first character.
Consume characters from STREAM until an END-OF-FILE is encountered or a non-whitespace (according to RFC 2616) characters is seen. This character is returned (or NIL in case of END-OF-FILE).
Returns true if the Lisp character CHAR is a token constituent according to RFC 2616.
Returns a version of the string STRING (between START and END) where spaces and tab characters are trimmed from the start and the end. Might return STRING.
chunked-input-stream
)) ¶chunked-input-stream
)) ¶Return EOF after the last chunk instead of simply switching chunking off.
The default method which always returns the empty list.
chunked-input-stream
)) ¶An alist of attribute/value
pairs corresponding to the optional ‘chunk extensions’ which
might be encountered when reading from a chunked stream.
The default method which always returns the empty list.
chunked-input-stream
)) ¶An alist of attribute/value
pairs corresponding to the optional ‘trailer’ HTTP headers which
might be encountered at the end of a chunked stream.
The default method for all objects which are not of type CHUNKED-INPUT-STREAM.
chunked-input-stream
)) ¶Whether input chunking is currently enabled.
chunked-input-stream
)) ¶Switches input chunking for STREAM on or off.
The default method for all objects which are not of type CHUNKED-OUTPUT-STREAM.
chunked-output-stream
)) ¶Whether output chunking is currently enabled.
chunked-output-stream
)) ¶Switches output chunking for STREAM on or off.
chunked-stream
)) ¶The actual stream that’s used for input and/or output.
chunked-stream
) &key abort) ¶If a chunked stream is closed, we close the underlying stream as well.
chunked-output-stream
) &key abort) ¶When a stream is closed and ABORT isn’t true we have to make sure to send the last chunk.
chunked-stream
)) ¶A chunked stream is open if its underlying stream is open.
chunked-input-stream
)) ¶Implements CLEAR-INPUT by resetting the internal chunk buffer.
sb-gray
.
chunked-output-stream
)) ¶We clear output by resetting the output buffer and clearing the underlying stream.
sb-gray
.
chunked-stream
)) ¶Chunked streams are always binary streams. Wrap them with flexi streams if you need a character stream.
chunked-output-stream
)) ¶Flush the output buffer if output chunking is on, then operate on the underlying stream.
sb-gray
.
chunked-output-stream
)) ¶Flush the output buffer if output chunking is on, then operate on the underlying stream.
sb-gray
.
chunked-input-stream
)) ¶We first check if input chunking is enabled and if there’s something in the buffer. Otherwise we poll the underlying stream.
sb-gray
.
chunked-input-stream
)) ¶Reads one byte from STREAM. Checks the chunk buffer first, if input chunking is enabled. Re-fills buffer is necessary.
sb-gray
.
chunked-input-stream
) sequence start end &key) ¶Fills SEQUENCE by adding data from the chunk buffer and re-filling it until enough data was read. Works directly on the underlying stream if input chunking is off.
trivial-gray-streams
.
chunked-output-stream
) byte) ¶Writes one byte by simply adding it to the end of the output buffer (if output chunking is enabled). The buffer is flushed if necessary.
sb-gray
.
chunked-output-stream
) sequence start end &key) ¶Outputs SEQUENCE by appending it to the output buffer if it’s small enough. Large sequences are written directly using WRITE-CHUNK.
trivial-gray-streams
.
Superclass for all errors related to Chunga. This
is a subtype of STREAM-ERROR, so STREAM-ERROR-STREAM can be used to
access the offending stream.
chunga-condition
.
stream-error
.
Superclass for all warnings related to Chunga.
chunga-condition
.
warning
.
A condition of this type is signaled if an
unexpected character (octet) is read while reading from a chunked
stream with input chunking enabled.
A condition of this type is signaled if we reach an unexpected EOF on a chunked stream with input chunking enabled.
Signalled if Chunga encounters wrong or unknown syntax when reading data.
A chunked stream is of this type if its
underlying stream is an input stream. This is a subtype of
CHUNKED-STREAM.
chunked-stream
.
fundamental-binary-input-stream
.
chunked-input-available-p
.
(setf chunked-input-stream-eof-after-last-chunk)
.
chunked-input-stream-eof-after-last-chunk
.
chunked-input-stream-extensions
.
chunked-input-stream-trailers
.
(setf chunked-stream-input-chunking-p)
.
chunked-stream-input-chunking-p
.
(setf chunked-stream-input-index)
.
chunked-stream-input-index
.
(setf chunked-stream-input-limit)
.
chunked-stream-input-limit
.
(setf expecting-crlf-p)
.
expecting-crlf-p
.
fill-buffer
.
stream-clear-input
.
stream-listen
.
stream-read-byte
.
stream-read-sequence
.
Whether input chunking is currently enabled.
This slot is read-only.
A vector containing the binary
data from the most recent chunk that was read.
The current position within INPUT-BUFFER.
0
Only the content in INPUT-BUFFER
up to INPUT-LIMIT belongs to the current chunk.
0
An alist of attribute/value
pairs corresponding to the optional ‘chunk extensions’ which
might be encountered when reading from a chunked stream.
This slot is read-only.
An alist of attribute/value
pairs corresponding to the optional ‘trailer’ HTTP headers which
might be encountered at the end of a chunked stream.
This slot is read-only.
Whether we expect to see
CRLF before we can read the next chunk-size header part from the
stream. (This will actually be the CRLF from the end of the
last chunk-data part.)
Return EOF after the last chunk instead of simply switching chunking off.
A chunked stream is of this type if it is both
a CHUNKED-INPUT-STREAM as well as a CHUNKED-OUTPUT-STREAM.
A chunked stream is of this type if its
underlying stream is an output stream. This is a subtype of
CHUNKED-STREAM.
chunked-stream
.
fundamental-binary-output-stream
.
Whether output chunking is currently enabled.
This slot is read-only.
A vector used to temporarily
store data which will output in one chunk.
(make-array chunga::+output-buffer-size+ :element-type (quote (unsigned-byte 8)))
The current end of OUTPUT-BUFFER.
0
Every chunked stream returned by
MAKE-CHUNKED-STREAM is of this type which is a subtype of
STREAM.
trivial-gray-stream-mixin
.
The actual stream that’s used for input and/or output.
:real-stream
This slot is read-only.
A 2-element array consisting of the character codes for a CRLF sequence.
The hexadecimal digits.
A hash table which maps keywords derived from +KNOWN-WORDS+ to capitalized strings.
A list of words (headers, methods, protocols, character sets) that are typically seen in HTTP communication. Mostly from RFC 2616, but includes WebDAV stuff and other things as well.
Size of the initial output buffer for chunked output.
A hash table which case-insensitively maps the strings from +KNOWN-WORDS+ to keywords.
A ‘buffer’ for one character. Used by PEEK-CHAR* and UNREAD-CHAR*.
Used by the functions in ‘read.lisp’ as a function to signal errors about unexpected characters when *CURRENT-ERROR-MESSAGE* is NIL.
A version of DEFCONSTANT for, cough, /strict/ CL implementations.
Evaluates EXPR, binds it to VAR, and executes BODY if VAR has a true value.
Reads the next two characters from STREAM and checks if these are a carriage return and a linefeed. Signals an error otherwise.
Returns true if the Lisp character CHAR is a CHAR according to RFC 2616.
Returns true if the Lisp character CHAR is a CTL according to RFC 2616.
Returns true if the sequence SEQ ends with the sequence SUFFIX. Individual elements are compared with TEST.
Converts the string STRING to a keyword where all characters are uppercase or lowercase, taking into account the current readtable case. Destructively modifies STRING if DESTRUCTIVEP is true.
Reads a cookie parameter value from STREAM which is returned as a string. Simply reads until a semicolon is seen (or an element of SEPARATORS). Also reads quoted strings if the first non-whitespace character is a quotation mark (as in RFC 2109).
Reads a quoted string (according to RFC 2616). It is assumed that the character at the current position is the opening quote character. Returns the string read without quotes and escape characters.
Returns true if the Lisp character CHAR is a separator according to RFC 2616.
Signals an error that LAST-CHAR was read although one of EXPECTED-CHARS was expected. (Note that EXPECTED-CHARS, despite its name, can also be a single character instead of a list). Calls *CURRENT-ERROR-FUNCTION* if it’s not NIL, or uses *CURRENT-ERROR-MESSAGE* otherwise.
Were simulating UNREAD-CHAR by putting the character into *CHAR-BUFFER*.
Returns true if the Lisp character CHAR is whitespace according to RFC 2616.
chunked-input-stream
)) ¶Whether there’s unread input waiting in the chunk buffer.
chunked-input-stream
)) ¶chunked-input-stream
)) ¶The current position within INPUT-BUFFER.
chunked-input-stream
)) ¶chunked-input-stream
)) ¶Only the content in INPUT-BUFFER
up to INPUT-LIMIT belongs to the current chunk.
chunked-input-stream
)) ¶chunked-input-stream
)) ¶Whether we expect to see
CRLF before we can read the next chunk-size header part from the
stream. (This will actually be the CRLF from the end of the
last chunk-data part.)
chunked-input-stream
)) ¶Re-fills the chunk buffer. Returns NIL if chunking has ended.
chunked-output-stream
)) ¶Uses WRITE-CHUNK to empty the output buffer unless it is already empty.
chunked-output-stream
)) ¶chunked-output-stream
)) ¶A vector used to temporarily
store data which will output in one chunk.
chunked-output-stream
)) ¶chunked-output-stream
)) ¶The current end of OUTPUT-BUFFER.
chunked-output-stream
) sequence &key start end) ¶Writes the contents of SEQUENCE from START to END to the underlying stream of STREAM as one chunk.
Superclass for all conditions related to Chunga.
condition
.
Like CHUNGA-ERROR but with formatting capabilities.
chunga-error
.
simple-condition
.
Like CHUNGA-WARNING but with formatting capabilities.
chunga-warning
.
simple-condition
.
Signalled if a function was called with inconsistent or illegal parameters.
Jump to: | (
A C D E F G H M O P R S T U W |
---|
Jump to: | (
A C D E F G H M O P R S T U W |
---|
Jump to: | *
+
C E I L O R S |
---|
Jump to: | *
+
C E I L O R S |
---|
Jump to: | C F I K O P R S U |
---|
Jump to: | C F I K O P R S U |
---|