Time-stamp: <98/07/14 14:59:37 shriram>

Package: cgi
Collection: net
Files: cgi.ss, cgic.ss, cgir.ss, cgis.ss, cgiu.ss

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

The cgi package helps programmers write scripts that follow the Common
Gateway Interface (CGI) protocol of the World-Wide Web.

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

binding:

  A binding is an association of a form item with its value.  Some form
  items (such as checkboxes) may correspond to multiple bindings.  A
  binding is a symbol-string pair.

bindings:

  A list of `binding's.

html-string:

  A text string that has been escaped according to HTML conventions.

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

struct cgi-error ()

  cgi-error is a super-structure for all exceptions thrown by this
  library.

struct (incomplete-%-suffix cgi-error) (chars)
chars : list (char)
  
  Used when a % in a query is followed by an incomplete suffix.  The
  characters of the suffix -- excluding the "%" -- are provided by the
  exception.

struct (invalid-%-suffix cgi-error) (char)
char : char

  Used when the character immediately following a % in a query is
  invalid.

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

get-bindings :
get-bindings/post :
get-bindings/get :
() -> bindings

  Returns the bindings that corresponding to the options specified by
  the user.  The /post and /get forms work only when POST and GET
  forms are used, respectively, while get-bindings determines the kind
  of form that was used and invokes the appropriate function.

extract-bindings :
(symbol + string) x bindings -> list (string)

  Given a key and a set of bindings, extract-bindings determines which
  ones correspond to a given key.  There may be zero, one, or many
  associations for a given key.

extract-binding/single :
string x bindings -> string
  
  Given a key and a set of bindings, extract-binding/single ensures
  that the key has exactly one association, and returns it.

generate-html-output :
html-string x list (html-string) x [color x color x color x color x
  color] -> ()

  The first argument is the title.  The second is a list of strings
  that consist of the body.  The last five arguments are each strings
  representing a HTML color; in order, they represent the color of the
  text, the background, un-visited links, visited links, and a link
  being selected.

generate-link-text :
string x html-string -> html-string

  Takes a string representing a URL, a html-string for the anchor
  text, and generates HTML corresponding to an achor.

generate-error-output :
list (html-string) -> <exit>

  The procedure takes a series of strings representing the body,
  prints them with the subject line "Internal error", and forces the
  script to exit.

get-cgi-method :
() -> string

  Returns either "GET" or "POST".  Always returns a string when
  invoked inside a CGI script.  Unpredictable otherwise.

bindings-as-html :
bindings -> list (html-string)

  Converts a set of bindings into a list of html-string's.  Useful for
  debugging.
