Object CGI - Easy C Based CGI
This release of "Object CGI"
is the first public release. It is available for non-commercial or educational
use (see the LICENSE file). If sufficient interest
is shown in "Object CGI" I will make it available for commercial use at a minimal cost. Contact me at: gmessner@messners.com and we can discuss it.
To download "Object CGI" save one of the following links:
Object CGI implements a wrapper around
all the CGI data that can be received from an HTTP server. To use Object CGI,
simply call Cgi_Open(),
at that time all CGI data is read and parsed. When you are through
using the CGI data call Cgi_Close()
to free any allocated data and delete any uploaded files owned by Object
CGI.
The CGI data can be accessed with
the following calls:
Additionally the following utility functions
are provided:
Cgi_Open(input_file)
- Parses all the CGI data, uploading
files to the directory specified by Cgi_SetFileDir().
Cgi_Close()
- Frees all CGI data allocated
by Cgi_Open(). Also deletes any uploaded
files owned by Object CGI.
Cgi_GetCookie(name)
- Gets a cookie value associated with the
name.
Cgi_GetEnvValue(name,
default_value)
- Gets the specified CGI environment variable.
If the environment variable was not set the default value will be
returned.
Cgi_GetFilename(name)
- Gets the uploaded filename associated
with the name. This is the actual name of the file stored on the server
side of the upload. Use Cgi_GetValue()
to get the name of the file that was uploaded. This filename is auto-generated
and retains the extension of the file that was uploaded.
Cgi_GetValue(name)
- Gets a value associated with the name.
Cgi_GetAllValues(name)
- Gets all values associated with name.
Cgi_EscapeLTGT(string)
- Replaces all instances of "<"
and ">" in a string with "<" and ">".
Cgi_FirstCookie()
- Gets the first cookie CGI_Pair *.
Cgi_FirstValue()
- Gets the first value CGI_Pair *.
Cgi_NextCookie(pair)
- Gets the next cookie CGI_Pair *.
Cgi_NextValue(pair)
- Gets the next value CGI_Pair *.
Cgi_OwnsFiles(cgi_owns_files)
- Tells the CGI library whether it owns
the uploaded files. If cgi_owns_files is set to TRUE,
any files uploaded (via CGI) are deleted when Cgi_Close()
is called.
Cgi_PrintEnv()
- Outputs an HTML formatted dump of the
CGI environment strings.
Cgi_PrintNameValuePairs()
- Outputs an HTML formatted dump of all
the CGI name/value pairs.
Cgi_SetFileDir(file_directory)
- Sets the directory for uploaded files.
Use this prior to calling Cgi_Open().
Default directory is "/tmp".
Cgi_strdup(string)
- Duplicates an ASCII NULL terminated string.
Cgi_unescape_url(url_string)
- Unescapes the URL encoding of a URL string.
This is used by the CGI library internally and is provided for the
consumers use.
This page has been accessed
times since 9 June, 1998