[Open Source Projects]
[Object CGI]
[License]
This release of "Object CGI" is the first public release. It is available for use under the LGPL (see the LICENSE file).
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:
Parses all the CGI data, uploading files to the directory specified by Cgi_SetFileDir().
Frees all CGI data allocated by Cgi_Open(). Also deletes any uploaded files owned by Object CGI.
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.
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.
Gets a value associated with the name.
Gets all values associated with name.
Replaces all instances of "<" and ">" in a string with "<" and ">".
Gets the first cookie CGI_Pair *.
Gets the first value CGI_Pair *.
Gets the next cookie CGI_Pair *.
Gets the next value CGI_Pair *.
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.
Outputs an HTML formatted dump of the CGI environment strings.
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".
Duplicates an ASCII NULL terminated string.
Unescapes the URL encoding of a URL string. This is used by the CGI library internally and is provided for the consumers use.