The darts.lib.email-address Reference Manual

This is the darts.lib.email-address Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:11:48 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 darts.lib.email-address

Parsing and formatting email addresses (RFC 5322 compliant)

Maintainer

Dirk Eßer

Author

Dirk Esser

License

MIT

Long Description
Version

0.1

Source

darts.lib.email-address.asd.

Child Component

src (module).


3 Modules

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


3.1 darts.lib.email-address/src

Source

darts.lib.email-address.asd.

Parent Component

darts.lib.email-address (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 darts.lib.email-address/darts.lib.email-address.asd

Source

darts.lib.email-address.asd.

Parent Component

darts.lib.email-address (system).

ASDF Systems

darts.lib.email-address.

Packages

darts.asdf.


4.1.2 darts.lib.email-address/src/package.lisp

Source

darts.lib.email-address.asd.

Parent Component

src (module).

Packages

darts.lib.email-address.


4.1.3 darts.lib.email-address/src/parser.lisp

Source

darts.lib.email-address.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.4 darts.lib.email-address/src/objects.lisp

Source

darts.lib.email-address.asd.

Parent Component

src (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 darts.lib.email-address

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5.2 darts.asdf

Source

darts.lib.email-address.asd.

Use List
  • asdf/interface.
  • common-lisp.

6 Definitions

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


6.1 Public Interface


6.1.1 Special variables

Special Variable: *allow-obsolete-syntax*
Package

darts.lib.email-address.

Source

parser.lisp.

Special Variable: *allow-unicode*
Package

darts.lib.email-address.

Source

parser.lisp.


6.1.2 Ordinary functions

Function: address (value)
Package

darts.lib.email-address.

Source

objects.lisp.

Reader: address-domain (instance)
Package

darts.lib.email-address.

Source

objects.lisp.

Target Slot

domain.

Function: address-hash (object)
Package

darts.lib.email-address.

Source

objects.lisp.

Reader: address-local-part (instance)
Package

darts.lib.email-address.

Source

objects.lisp.

Target Slot

local-part.

Function: address-string (object)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: address/= (a1 a2)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: address< (a1 a2)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: address<= (a1 a2)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: address= (a1 a2)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: address> (a1 a2)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: address>= (a1 a2)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: addressp (object)
Package

darts.lib.email-address.

Source

objects.lisp.

Function: escape-display-name (string &key start end)

escape-display-name STRING &optional START END => ANSWER

Returns a copy of the portion of STRING between START (incl.) and END (excl.). If necessary, this function adds quotes around the result, and makes sure, that it satisfies the rules of an email display name.

Package

darts.lib.email-address.

Source

parser.lisp.

Function: escape-local-part (string &key start end)

escape-local-part STRING &optional START END => ANSWER

Returns a copy of the portion of STRING between START (incl.) and END (excl.). If necessary, this function adds quotes around the result, and makes sure, that internal occurrences of #\\ and #\" are properly escaped.

Package

darts.lib.email-address.

Source

parser.lisp.

Function: mailbox (value)

Coerces the given ‘value’ into an instance of class ‘mailbox’ or
a suitable subclass.

- if ‘value’ is already a ‘mailbox’, it is directly returned

- if ‘value’ is an ‘address’, a new mailbox instance is created, using that address and a display name value of nil.

- if ‘value’ is a string, it is parsed according to the RFC 5322 ‘mailbox’ production and a mailbox instance is created from the results.

If the value cannot be coerced, signals a condition of type ‘type-error’.

Package

darts.lib.email-address.

Source

objects.lisp.

Function: make-address (local-part domain)

Creates a new address from the given component values ‘local-part’ and ‘domain’. Both arguments must be strings. Note, that this function currently does not validate the contents of the given local part and domain values.

Package

darts.lib.email-address.

Source

objects.lisp.

Function: parse-rfc5322-addr-spec (string &key start end allow-unicode allow-trailing-junk)

parse-rfc5322-addr-spec STRING &key START END => LOCAL-PART DOMAIN POSITION

Parses an email address (rule addr-spec in RFC 5322) from STRING, starting at index START (inclusive, defaults to 0), and stopping at index END (exclusive, defaults to the length of STRING).

Returns four values

1. the local part of the email address
2. the domain part of the email address
3. an error code, or nil, if the parsing was successful
4. the index of the first character not processed

This function stops after finding a complete email address, when it encounters an error, or when reaching the END index. The following error codes are defined:

nil no error, a full email address has been found :bad-local-part no valid local part could be found
:missing-separator the ‘@´ was not found
:bad-domain no valid domain part could be found
:trailing-garbage unprocessed characters remain after the address

Package

darts.lib.email-address.

Source

parser.lisp.

Function: parse-rfc5322-mailbox (string &key start end allow-unicode allow-obsolete-syntax allow-trailing-junk)

parse-rfc5322-mailbox STRING &optional START END => LOCAL-PART DOMAIN DISPLAY-NAME ERROR POSITION

Package

darts.lib.email-address.

Source

parser.lisp.

Function: parse-rfc5322-mailbox-list (string &key start end allow-unicode allow-obsolete-syntax)
Package

darts.lib.email-address.

Source

parser.lisp.


6.1.3 Generic functions

Generic Function: mailbox-address (object)

Answers the ‘address’ instance, which describes the actual
email address associated with mailbox ‘object’. This method is part of the core mailbox protocol, and must be implemented by all objects, which want to participate in that protocol.

Package

darts.lib.email-address.

Source

objects.lisp.

Methods
Reader Method: mailbox-address ((basic-mailbox basic-mailbox))

automatically generated reader method

Target Slot

mailbox-address.

Method: mailbox-address ((object address))
Generic Function: mailbox-display-name (object)

Answers the display name associated with the given mailbox
instance ‘object’. This function is part of the core mailbox protocol and must be implemented by all objects, which want to participate in that protocol.

Package

darts.lib.email-address.

Source

objects.lisp.

Methods
Reader Method: mailbox-display-name ((basic-mailbox basic-mailbox))

automatically generated reader method

Target Slot

mailbox-display-name.

Method: mailbox-display-name ((object address))
Generic Function: mailbox-domain (object)

Answers the domain string of this mailbox’s address.
The default method simply extracts the ‘address-domain’ from the object returned by ‘mailbox-address’ when applied to the given ‘object’.

Package

darts.lib.email-address.

Source

objects.lisp.

Methods
Method: mailbox-domain ((object address))
Method: mailbox-domain (object)
Generic Function: mailbox-local-part (object)

Answers the local part string of this mailbox’s address.
The default method simply extracts the ‘address-local-part’ from the object returned by ‘mailbox-address’ when applied to the given ‘object’.

Package

darts.lib.email-address.

Source

objects.lisp.

Methods
Method: mailbox-local-part ((object address))
Method: mailbox-local-part (object)
Generic Function: mailbox-string (object)

Constructs a string representation of the given mailbox
instance. The result is required to be a well-formed RFC 5322 email address parsable using the ‘mailbox’ production. The default method should be usable by almost all concrete ‘mailbox’ implementations.

Package

darts.lib.email-address.

Source

objects.lisp.

Methods
Method: mailbox-string ((object address))
Method: mailbox-string (object)
Generic Function: mailboxp (object)

Tests, whether ‘object’ fulfills the ‘mailbox’ protocol.
This condition is always true by definition for subclasses of class ‘mailbox’. It may additionally be true for other objects.

Package

darts.lib.email-address.

Source

objects.lisp.

Methods
Method: mailboxp ((object address))
Method: mailboxp ((object mailbox))
Method: mailboxp (object)

6.1.4 Standalone methods

Method: print-object ((object mailbox) stream)
Source

objects.lisp.

Method: print-object ((object address) stream)
Source

objects.lisp.

Method: shared-initialize :after ((object basic-mailbox) slots &key address)
Source

objects.lisp.


6.1.5 Structures

Structure: address

Plain email address, composed of the local part (a string) and the domain (another string). Instances of this structure class are immutable after construction. This structure class fully supports the mailbox protocol.

Package

darts.lib.email-address.

Source

objects.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: local-part
Type

simple-string

Initform

(error "missing local part")

Readers

address-local-part.

Writers

This slot is read-only.

Slot: domain
Type

simple-string

Initform

(error "missing domain")

Readers

address-domain.

Writers

This slot is read-only.

Slot: %string
Type

(or null simple-string)

Readers

address-%string.

Writers

(setf address-%string).

Slot: %hash
Type

fixnum

Initform

-1

Readers

address-%hash.

Writers

(setf address-%hash).


6.1.6 Classes

Class: basic-mailbox

A simple concrete implementation of ‘mailbox’, which
stores the address and display name information in dedicated slots.

Package

darts.lib.email-address.

Source

objects.lisp.

Direct superclasses

mailbox.

Direct methods
Direct slots
Slot: mailbox-address
Type

darts.lib.email-address:address

Readers

mailbox-address.

Writers

This slot is read-only.

Slot: mailbox-display-name
Type

(or null string)

Initargs

:display-name

Readers

mailbox-display-name.

Writers

This slot is read-only.

Class: mailbox

A mailbox is basically an email address combined with an
optional display name for that address. This class itself is only a protocol class, and exists for the purpose of type discrimination only.

Package

darts.lib.email-address.

Source

objects.lisp.

Direct subclasses

basic-mailbox.

Direct methods

6.2 Internals


6.2.1 Macros

Macro: recurr (name bindings &body body)
Package

darts.lib.email-address.

Source

parser.lisp.


6.2.2 Ordinary functions

Function: %make-addr (local-part domain)
Package

darts.lib.email-address.

Source

objects.lisp.

Reader: address-%hash (instance)
Writer: (setf address-%hash) (instance)
Package

darts.lib.email-address.

Source

objects.lisp.

Target Slot

%hash.

Reader: address-%string (instance)
Writer: (setf address-%string) (instance)
Package

darts.lib.email-address.

Source

objects.lisp.

Target Slot

%string.

Function: atext-char-p (char)
Package

darts.lib.email-address.

Source

parser.lisp.

Function: ctext-char-p (char)
Package

darts.lib.email-address.

Source

parser.lisp.

Function: dtext-char-p (char)
Package

darts.lib.email-address.

Source

parser.lisp.

Function: fws-char-p (char)
Package

darts.lib.email-address.

Source

parser.lisp.

Function: make-buffer (&optional length)
Package

darts.lib.email-address.

Source

parser.lisp.

Function: next-token (string start &optional end)
Package

darts.lib.email-address.

Source

parser.lisp.

Function: qtext-char-p (char)
Package

darts.lib.email-address.

Source

parser.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   C   D   E   F   G   M   N   P   Q   R   S  
Index Entry  Section

%
%make-addr: Private ordinary functions

(
(setf address-%hash): Private ordinary functions
(setf address-%string): Private ordinary functions

A
address: Public ordinary functions
address-%hash: Private ordinary functions
address-%string: Private ordinary functions
address-domain: Public ordinary functions
address-hash: Public ordinary functions
address-local-part: Public ordinary functions
address-string: Public ordinary functions
address/=: Public ordinary functions
address<: Public ordinary functions
address<=: Public ordinary functions
address=: Public ordinary functions
address>: Public ordinary functions
address>=: Public ordinary functions
addressp: Public ordinary functions
atext-char-p: Private ordinary functions

C
ctext-char-p: Private ordinary functions

D
dtext-char-p: Private ordinary functions

E
escape-display-name: Public ordinary functions
escape-local-part: Public ordinary functions

F
Function, %make-addr: Private ordinary functions
Function, (setf address-%hash): Private ordinary functions
Function, (setf address-%string): Private ordinary functions
Function, address: Public ordinary functions
Function, address-%hash: Private ordinary functions
Function, address-%string: Private ordinary functions
Function, address-domain: Public ordinary functions
Function, address-hash: Public ordinary functions
Function, address-local-part: Public ordinary functions
Function, address-string: Public ordinary functions
Function, address/=: Public ordinary functions
Function, address<: Public ordinary functions
Function, address<=: Public ordinary functions
Function, address=: Public ordinary functions
Function, address>: Public ordinary functions
Function, address>=: Public ordinary functions
Function, addressp: Public ordinary functions
Function, atext-char-p: Private ordinary functions
Function, ctext-char-p: Private ordinary functions
Function, dtext-char-p: Private ordinary functions
Function, escape-display-name: Public ordinary functions
Function, escape-local-part: Public ordinary functions
Function, fws-char-p: Private ordinary functions
Function, mailbox: Public ordinary functions
Function, make-address: Public ordinary functions
Function, make-buffer: Private ordinary functions
Function, next-token: Private ordinary functions
Function, parse-rfc5322-addr-spec: Public ordinary functions
Function, parse-rfc5322-mailbox: Public ordinary functions
Function, parse-rfc5322-mailbox-list: Public ordinary functions
Function, qtext-char-p: Private ordinary functions
fws-char-p: Private ordinary functions

G
Generic Function, mailbox-address: Public generic functions
Generic Function, mailbox-display-name: Public generic functions
Generic Function, mailbox-domain: Public generic functions
Generic Function, mailbox-local-part: Public generic functions
Generic Function, mailbox-string: Public generic functions
Generic Function, mailboxp: Public generic functions

M
Macro, recurr: Private macros
mailbox: Public ordinary functions
mailbox-address: Public generic functions
mailbox-address: Public generic functions
mailbox-address: Public generic functions
mailbox-display-name: Public generic functions
mailbox-display-name: Public generic functions
mailbox-display-name: Public generic functions
mailbox-domain: Public generic functions
mailbox-domain: Public generic functions
mailbox-domain: Public generic functions
mailbox-local-part: Public generic functions
mailbox-local-part: Public generic functions
mailbox-local-part: Public generic functions
mailbox-string: Public generic functions
mailbox-string: Public generic functions
mailbox-string: Public generic functions
mailboxp: Public generic functions
mailboxp: Public generic functions
mailboxp: Public generic functions
mailboxp: Public generic functions
make-address: Public ordinary functions
make-buffer: Private ordinary functions
Method, mailbox-address: Public generic functions
Method, mailbox-address: Public generic functions
Method, mailbox-display-name: Public generic functions
Method, mailbox-display-name: Public generic functions
Method, mailbox-domain: Public generic functions
Method, mailbox-domain: Public generic functions
Method, mailbox-local-part: Public generic functions
Method, mailbox-local-part: Public generic functions
Method, mailbox-string: Public generic functions
Method, mailbox-string: Public generic functions
Method, mailboxp: Public generic functions
Method, mailboxp: Public generic functions
Method, mailboxp: Public generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, shared-initialize: Public standalone methods

N
next-token: Private ordinary functions

P
parse-rfc5322-addr-spec: Public ordinary functions
parse-rfc5322-mailbox: Public ordinary functions
parse-rfc5322-mailbox-list: Public ordinary functions
print-object: Public standalone methods
print-object: Public standalone methods

Q
qtext-char-p: Private ordinary functions

R
recurr: Private macros

S
shared-initialize: Public standalone methods


A.4 Data types