Lightweight CGI Library

Use of the CGI Library

This library provides a very simple interface to CGI programming in C. It is meant to support programs that communicate with the web user via HTML forms and GET variables.

Basically, you'll need to add the following code to your programs.

Introduce CGI library:

   #include <cgi.h>

   s_cgi *cgi;
   cgi = cgiInit();

Fetch the value of a FORM-variable:

   name = cgiGetValue (cgi, "name");

Fetch the temporary filename of an uploaded file:

   file = cgiGetFile (cgi, "name");

Fetch the value of a cookie:

   cookie = cgiGetCookie (cgi, "cookie-name");

Set a cookie yourself:

   cgiSetHeader ("Set-Cookie", "Version=1; name=value; Path=/");

 

News
2009-02-08 Version 0.7 released more2008-04-06 Version 0.6 released more2001-01-02 Web pages for this project more

Download
Version 0.7 (262 kB)
Version 0.6 (24 kB)
Version 0.5 (13 kB)
Version 0.4 (8 kB)

Contributors
Neal H. Walfield
Mikko Torni
Neil Spring
Phil Brooke
Miguel Freitas