Time-stamp: <98/03/17 20:22:13 shriram>

Package: nntp
Collection: net
Files: nntp.ss, nntpr.ss, nntps.ss, nntpu.ss

ABSTRACT -------------------------------------------------------------

The nntp package helps programmers access Usenet groups via the NNTP
protocols.

TYPES ----------------------------------------------------------------

communicator:
struct communicator (sender receiver server port)
sender : oport
receiver : iport
server : string
port : number
  
  Once a connection to a Usenet server has been established, its state
  is stored in a communicator, and other procedures take communicators
  as an argument.

desired:

  A regular expression that matches against a Usenet header.

EXCEPTIONS -----------------------------------------------------------

struct (nntp exn) ()

  The super-struct of all subsequent exceptions.

struct (unexpected-response nntp) (code text)
code : number
text : string

  Thrown whenever an unexpected response code is received.  The text
  holds the response text sent by the server.

struct (bad-status-line nntp) (line)
line : string

  Mal-formed status lines.

struct (premature-close nntp) (communicator)
communicator : communicator

  Thrown when a remote server closes its connection unexpectedly.

struct (bad-newsgroup-line nntp) (line)
line : string

  When the newsgroup line is improperly formatted.

struct (non-existent-group nntp) (group)
group : string

  When the server does not recognize the name of the requested group.

struct (article-not-in-group nntp) (article)
article : number

  When an article is outside the server's range for that group.

struct (no-group-selected nntp) ()

  When an article operation is used before a group has been selected.

struct (article-not-found struct:nntp) (article)
article : number

  When the server is unable to locate the article.

PROCEDURES -----------------------------------------------------------

connect-to-server :
string [x number] -> communicator

  Connects to the name server.  The second argument, if provided, must
  be a port number; otherwise the default NNTP port is used.

disconnect-from-server :
communicator -> ()

  Disconnects a communicator.

open-news-group :
communicator x string -> number x number x number

  The second argument is the name of a newsgroup.  The returned values
  are the total number of articles in that group, the first available
  article, and the last available article.

head-of-message :
communicator x number -> list (string)

  Given a message number, returns its headers.

body-of-message :
communicator x number -> list (string)

  Given a message number, returns the body of the message.

make-desired-header :
string -> desired

  Takes the header's tag and returns a desired regexp for that header.

extract-desired-headers :
list (string) x list (desired) -> list (string)

  Given a list of headers and of desired's, returns the header lines
  that match any of the desired's.
