This is a Gauche extension module to use FastCGI.

[Requirements]

- Gauche (http://www.shiro.dreamhost.com/scheme/gauche/)
- FastCGI Development Kit (http://www.fastcgi.com/)

[Building]

  % ./configure
  % make
  % make install

[Usage]

Gauche-fastcgi is an extension module to write FastCGI applications.
Current version of this module provides only one useful function:
with-fastcgi.

Function: with-fastcgi thunk

This function repeats the following processes eternally.

1. Accept the request via FastCGI protocol
2. Set the current input/output/error ports and cgi-metavariables properly
3. Call thunk

By wrapping around with-fastcgi, CGI scripts are easily turned into
FastCGI applications.  FastCGI'd scripts are persistent and do not
create process per request.  In short, your CGI scripts can be boosted
by using with-fastcgi.

The following script is a FastCGI-ized version of the example shown in
the Gauche Reference Manual. This can also be run as a normal CGI
script.

(use text.html-lite)
(use www.cgi)
(use www.fastcgi)

(define (main args)
  (with-fastcgi
    (lambda ()
      (cgi-main
       (lambda (params)
         `(,(cgi-header)
           ,(html-doctype)
           ,(html:html
             (html:head (html:title "Example"))
             (html:body
              (html:table
               :border 1
               (html:tr (html:th "Name") (html:th "Value"))
               (map (lambda (p)
                      (html:tr
                       (html:td (html-escape-string (car p)))
                       (html:td (html-escape-string (x->string (cdr p))))))
                    params))))
           ))))))
