You are looking at historical revision 14356 of this page. It may differ significantly from its current revision.

dict

Description

Pure scheme implementation of a rfc2229 protocol client. This is a rewrite of the dict.egg available for chicken 3.x which was a wrapper around libdict.

Author

David Krentzlin

Download

dict.egg

Requirements

Requires the defstruct extension

Documentation

This extension provides a set of procedures, that can be used to communicate with dict-servers. At the moment of this writing it supports almost all commands of the dict-protocol. authentication and mime-headers are currently not supported, but will be once the needed extensions are available.

Connect/Disconnect

Connects to the dict-server with the specified port or the default-port as specified in rfc22229 (2628). Once the connection is established, the server's banner is parsed and information are extracted. Finally the procedure issues a client-command with the specified client-string as parameter. The value for timout is directly used to set the timeout for tcp-connect. The procedure returns a connection-object on success and signals an error otherwise.

Closes the connection represented by CONNECTION and sets its status status do disconnected. Returns #t if the connection was closes successfully and false otherwise.

Status-responses

In case of an error the command-procedures return the status-response send by the server. In order to identify a status or present an error-message to the user, there are procedures that deal with status-response-objects

Check if a response is a status-response.

Checks if the given status-response represents an error.

Retrieve the status-code (a positive fixnum) of the STATUS-RESPONSE.

Retrieve the textual information send by the server for this STATUS-RESPONSE

Map status-codes to textual-representation as specified in rfc2229

Status-Response-Predicates

For each status-response-type there is a predicate that checks whether a given status-response represents that specific type. See the list of status-predicates at the end of this documentation.

Commands

Example

List of status-predicates