#include <infodrom.style>
#include <projects.style>

<projectpg project="Lightweight CGI Library" maxcontrib=5>

<h3>Use of the CGI Library</h3>

<p>This library is intend to provide an easy interface to CGI programming
for the Free Software Community.  Please see how easy it is to work
with CGI.

<p>To use this library you need to include the cgi.h include file with the
following command into your C programs:

<p><pre>
   \#include &lt;cgi.h&gt;
</pre>

<p>Additionally you'll have to add the library libcgi.a to the linker,
either by modifying LDFLAGS in your makefiles or by adding `-lcgi' to
the appropriate commandline.

<p><pre>
   \#include &lt;cgi.h&gt;

   <b>s_cgi *cgiArg;</b>

   void main()
   {
       char *url;
       char *server_url = NULL;

       <b>cgiArg = cgiInit ()</b>;

       server_url = getenv("SERVER_URL");
       if ((url = <b>cgiGetValue(cgiArg, "url")</b>) == NULL) {
           if (server_url)
               <b>cgiRedirect(server_url)</b>;
           else
               <b>cgiRedirect("/")</b>;
       } else
           <b>cgiRedirect(url)</b>;
   }
</pre>

</projectpg>

# Local variables:
# mode: html
# mode: auto-fill
# end:
