The rfc2388-binary Reference Manual

This is the rfc2388-binary Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:36:31 2024 GMT+0.

Table of Contents


1 Systems

The main system appears first, followed by any subsystem dependency.


1.1 rfc2388-binary

Source

rfc2388-binary.asd.

Child Component

source (module).


2 Modules

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


2.1 rfc2388-binary/source

Source

rfc2388-binary.asd.

Parent Component

rfc2388-binary (system).

Child Components

3 Files

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


3.1 Lisp


3.1.1 rfc2388-binary/rfc2388-binary.asd

Source

rfc2388-binary.asd.

Parent Component

rfc2388-binary (system).

ASDF Systems

rfc2388-binary.


3.1.2 rfc2388-binary/source/packages.lisp

Source

rfc2388-binary.asd.

Parent Component

source (module).

Packages

rfc2388-binary.


3.1.3 rfc2388-binary/source/utils.lisp

Dependency

packages.lisp (file).

Source

rfc2388-binary.asd.

Parent Component

source (module).

Internals

3.1.4 rfc2388-binary/source/api.lisp

Dependencies
Source

rfc2388-binary.asd.

Parent Component

source (module).

Public Interface
Internals

mime-header (class).


3.1.5 rfc2388-binary/source/parsing.lisp

Dependencies
Source

rfc2388-binary.asd.

Parent Component

source (module).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 rfc2388-binary

Source

packages.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: parse-header-value (header-value-string)

Returns the value in header-value-string and any associated attributes.

Package

rfc2388-binary.

Source

parsing.lisp.

Function: parse-mime (source boundary &key write-content-to-file byte-encoder)

Parses MIME entities, returning them as a list.

Each element in the list is of form: (body headers), where BODY is the contents of MIME part, and HEADERS are all headers for that part. BOUNDARY is a string used to separate MIME entities.

This is the convenience interface to READ-MIME, all data is read into memory or a file and we assume that every byte in the data corresponds to exactly one character.

The SOURCE and BOUNDARY arguments are passed unchanged to READ-MIME. See READ-MIME’s documentation for details.

Package

rfc2388-binary.

Source

api.lisp.

Function: print-mime-part (part &optional stream)
Package

rfc2388-binary.

Source

api.lisp.


5.1.2 Generic functions

Generic Reader: content (object)
Package

rfc2388-binary.

Methods
Reader Method: content ((mime-part mime-part))

automatically generated reader method

Source

api.lisp.

Target Slot

content.

Generic Writer: (setf content) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf content) ((mime-part mime-part))

automatically generated writer method

Source

api.lisp.

Target Slot

content.

Generic Reader: content-charset (object)
Package

rfc2388-binary.

Methods
Reader Method: content-charset ((mime-part mime-part))

automatically generated reader method

Source

api.lisp.

Target Slot

content-charset.

Generic Writer: (setf content-charset) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf content-charset) ((mime-part mime-part))

automatically generated writer method

Source

api.lisp.

Target Slot

content-charset.

Generic Reader: content-length (object)
Package

rfc2388-binary.

Methods
Reader Method: content-length ((mime-part mime-part))

automatically generated reader method

Source

api.lisp.

Target Slot

content-length.

Generic Writer: (setf content-length) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf content-length) ((mime-part mime-part))

automatically generated writer method

Source

api.lisp.

Target Slot

content-length.

Generic Reader: content-type (object)
Package

rfc2388-binary.

Methods
Reader Method: content-type ((mime-part mime-part))

automatically generated reader method

Source

api.lisp.

Target Slot

content-type.

Generic Writer: (setf content-type) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf content-type) ((mime-part mime-part))

automatically generated writer method

Source

api.lisp.

Target Slot

content-type.

Generic Function: get-header (part header-name)

Returns the mime-header object for the header named HEADER-NAME (a string).

Package

rfc2388-binary.

Source

api.lisp.

Methods
Method: get-header ((part mime-part) (header-name string))
Generic Function: get-header-attribute (header name)

Returns the value of the attribute named NAME in the header HEADER.

Package

rfc2388-binary.

Source

api.lisp.

Methods
Method: get-header-attribute ((header mime-header) (name string))
Generic Reader: header-attributes (object)
Package

rfc2388-binary.

Methods
Reader Method: header-attributes ((mime-header mime-header))

automatically generated reader method

Source

api.lisp.

Target Slot

attributes.

Generic Writer: (setf header-attributes) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf header-attributes) ((mime-header mime-header))

automatically generated writer method

Source

api.lisp.

Target Slot

attributes.

Generic Reader: header-name (object)
Package

rfc2388-binary.

Methods
Reader Method: header-name ((mime-header mime-header))

automatically generated reader method

Source

api.lisp.

Target Slot

name.

Generic Writer: (setf header-name) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf header-name) ((mime-header mime-header))

automatically generated writer method

Source

api.lisp.

Target Slot

name.

Generic Reader: header-value (object)
Package

rfc2388-binary.

Methods
Reader Method: header-value ((mime-header mime-header))

automatically generated reader method

Source

api.lisp.

Target Slot

value.

Generic Writer: (setf header-value) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf header-value) ((mime-header mime-header))

automatically generated writer method

Source

api.lisp.

Target Slot

value.

Generic Reader: headers (object)
Package

rfc2388-binary.

Methods
Reader Method: headers ((mime-part mime-part))

automatically generated reader method

Source

api.lisp.

Target Slot

headers.

Generic Writer: (setf headers) (object)
Package

rfc2388-binary.

Methods
Writer Method: (setf headers) ((mime-part mime-part))

automatically generated writer method

Source

api.lisp.

Target Slot

headers.

Generic Function: mime-part-p (object)
Package

rfc2388-binary.

Source

api.lisp.

Methods
Method: mime-part-p ((object mime-part))
Method: mime-part-p (object)
Generic Function: read-mime (source boundary callback)

Parses the MIME entites in SOURCE.

SOURCE is either a vector of (unsigned-byte 8) or a stream whose element-type is (unsigned-byte 8). BOUNDARY is either a string of US-ASCII encodeable characters or a byte vector. CALLBACK is a function which will be passed one argument, a MIME-PART containing the headers of the mime part and must return the following values:

- a byte-handler function. This is a one argument function which will be passed every byte in the mime part’s content.

- a termination function. This is a function without arguments and will be called when the operation finishes without errors. It must return whatever is to be returned from read-mime.

- an optional abort function. This is a function without arguments and will be called when the operation is aborted due to an error.

READ-MIME consumes bytes from SOURCE and returns a list of the whatever the various termination functions returned.

Example:

(read-mime #<a binary stream> "123"
(lambda (mime-part)
(values (lambda (byte) (collect-byte-somewhere byte)) (lambda () mime-part))))

This call would return a list of mime-part objects passing each byte to collect-byte-somewhere.

You may also want to look at UCW for a real-world example.

Package

rfc2388-binary.

Source

api.lisp.

Methods
Method: read-mime ((source stream) (boundary array) callback-factory)
Source

parsing.lisp.

Method: read-mime ((source stream) (boundary string) callback-factory)
Source

parsing.lisp.

Method: read-mime ((source string) boundary callback-factory)
Source

parsing.lisp.


5.1.3 Classes

Class: mime-part
Package

rfc2388-binary.

Source

api.lisp.

Direct methods
Direct slots
Slot: content
Readers

content.

Writers

(setf content).

Slot: content-length
Readers

content-length.

Writers

(setf content-length).

Slot: content-type
Readers

content-type.

Writers

(setf content-type).

Slot: content-charset
Readers

content-charset.

Writers

(setf content-charset).

Slot: headers
Initform

(quote nil)

Readers

headers.

Writers

(setf headers).


5.2 Internals


5.2.1 Special variables

Special Variable: *debug*

When T we compile the code with some logging statements built in.

Package

rfc2388-binary.

Source

utils.lisp.


5.2.2 Macros

Macro: debug-message (message &rest message-control)
Package

rfc2388-binary.

Source

utils.lisp.


5.2.3 Ordinary functions

Function: as-ascii-char (byte)

Assuming BYTE is an ASCII coded character retun the corresponding character.

Package

rfc2388-binary.

Source

utils.lisp.

Function: ascii-string-to-boundary-array (string)
Package

rfc2388-binary.

Source

utils.lisp.

Function: linear-whitespace-byte? (byte)

In short: is it a space or a tab?

Package

rfc2388-binary.

Source

utils.lisp.

Function: make-mime-buffer-writer (&key byte-encoder)
Package

rfc2388-binary.

Source

utils.lisp.

Function: make-mime-file-writer (file-name &key byte-encoder)
Package

rfc2388-binary.

Source

utils.lisp.

Function: mime-part-headers-to-alist (mime-part content)
Package

rfc2388-binary.

Source

utils.lisp.

Function: parse-key-values (key-value-string)

Returns an alist of the keys and values in KEY-VALUE-STRING.

KEY-VALUE-STRING is of the form: (w+="w+";)*

Package

rfc2388-binary.

Source

parsing.lisp.

Function: read-next-header (stream)

Reads the next header from STREAM. Returns, as the first value, T if a header was found and NIL otherwise. When a header is found two more values are returned: the header name (a string) and the header value (also a string). Headers are assumed to be encoded in 7bit ASCII.

The returned strings may actually be displaced arrays.

Package

rfc2388-binary.

Source

parsing.lisp.

Function: read-until-next-boundary (stream boundary data-handler &key assume-first-boundary)

Reads from STREAM up to the next boundary. For every byte of data in stream we call DATA-HANDLER passing it the byte. Returns T if there’s more data to be read, NIL otherwise.

The ASSUME-FIRST-BOUNDARY parameter should T if we’re reading the first part of a MIME message, where there is no leading CR LF sequence.

Package

rfc2388-binary.

Source

parsing.lisp.


5.2.4 Classes

Class: mime-header
Package

rfc2388-binary.

Source

api.lisp.

Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

header-name.

Writers

(setf header-name).

Slot: value
Initargs

:value

Readers

header-value.

Writers

(setf header-value).

Slot: attributes
Initargs

:attributes

Readers

header-attributes.

Writers

(setf header-attributes).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   F   G   H   L   M   P   R  
Index Entry  Section

(
(setf content): Public generic functions
(setf content): Public generic functions
(setf content-charset): Public generic functions
(setf content-charset): Public generic functions
(setf content-length): Public generic functions
(setf content-length): Public generic functions
(setf content-type): Public generic functions
(setf content-type): Public generic functions
(setf header-attributes): Public generic functions
(setf header-attributes): Public generic functions
(setf header-name): Public generic functions
(setf header-name): Public generic functions
(setf header-value): Public generic functions
(setf header-value): Public generic functions
(setf headers): Public generic functions
(setf headers): Public generic functions

A
as-ascii-char: Private ordinary functions
ascii-string-to-boundary-array: Private ordinary functions

C
content: Public generic functions
content: Public generic functions
content-charset: Public generic functions
content-charset: Public generic functions
content-length: Public generic functions
content-length: Public generic functions
content-type: Public generic functions
content-type: Public generic functions

D
debug-message: Private macros

F
Function, as-ascii-char: Private ordinary functions
Function, ascii-string-to-boundary-array: Private ordinary functions
Function, linear-whitespace-byte?: Private ordinary functions
Function, make-mime-buffer-writer: Private ordinary functions
Function, make-mime-file-writer: Private ordinary functions
Function, mime-part-headers-to-alist: Private ordinary functions
Function, parse-header-value: Public ordinary functions
Function, parse-key-values: Private ordinary functions
Function, parse-mime: Public ordinary functions
Function, print-mime-part: Public ordinary functions
Function, read-next-header: Private ordinary functions
Function, read-until-next-boundary: Private ordinary functions

G
Generic Function, (setf content): Public generic functions
Generic Function, (setf content-charset): Public generic functions
Generic Function, (setf content-length): Public generic functions
Generic Function, (setf content-type): Public generic functions
Generic Function, (setf header-attributes): Public generic functions
Generic Function, (setf header-name): Public generic functions
Generic Function, (setf header-value): Public generic functions
Generic Function, (setf headers): Public generic functions
Generic Function, content: Public generic functions
Generic Function, content-charset: Public generic functions
Generic Function, content-length: Public generic functions
Generic Function, content-type: Public generic functions
Generic Function, get-header: Public generic functions
Generic Function, get-header-attribute: Public generic functions
Generic Function, header-attributes: Public generic functions
Generic Function, header-name: Public generic functions
Generic Function, header-value: Public generic functions
Generic Function, headers: Public generic functions
Generic Function, mime-part-p: Public generic functions
Generic Function, read-mime: Public generic functions
get-header: Public generic functions
get-header: Public generic functions
get-header-attribute: Public generic functions
get-header-attribute: Public generic functions

H
header-attributes: Public generic functions
header-attributes: Public generic functions
header-name: Public generic functions
header-name: Public generic functions
header-value: Public generic functions
header-value: Public generic functions
headers: Public generic functions
headers: Public generic functions

L
linear-whitespace-byte?: Private ordinary functions

M
Macro, debug-message: Private macros
make-mime-buffer-writer: Private ordinary functions
make-mime-file-writer: Private ordinary functions
Method, (setf content): Public generic functions
Method, (setf content-charset): Public generic functions
Method, (setf content-length): Public generic functions
Method, (setf content-type): Public generic functions
Method, (setf header-attributes): Public generic functions
Method, (setf header-name): Public generic functions
Method, (setf header-value): Public generic functions
Method, (setf headers): Public generic functions
Method, content: Public generic functions
Method, content-charset: Public generic functions
Method, content-length: Public generic functions
Method, content-type: Public generic functions
Method, get-header: Public generic functions
Method, get-header-attribute: Public generic functions
Method, header-attributes: Public generic functions
Method, header-name: Public generic functions
Method, header-value: Public generic functions
Method, headers: Public generic functions
Method, mime-part-p: Public generic functions
Method, mime-part-p: Public generic functions
Method, read-mime: Public generic functions
Method, read-mime: Public generic functions
Method, read-mime: Public generic functions
mime-part-headers-to-alist: Private ordinary functions
mime-part-p: Public generic functions
mime-part-p: Public generic functions
mime-part-p: Public generic functions

P
parse-header-value: Public ordinary functions
parse-key-values: Private ordinary functions
parse-mime: Public ordinary functions
print-mime-part: Public ordinary functions

R
read-mime: Public generic functions
read-mime: Public generic functions
read-mime: Public generic functions
read-mime: Public generic functions
read-next-header: Private ordinary functions
read-until-next-boundary: Private ordinary functions