new_cgi

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
LICENSE
VERSION
SEE ALSO

NAME

new_cgi, cgi_params, cgi_param, cgi_param_list, cgi_erase, copy_cgi - Library for parsing CGI query strings.

SYNOPSIS

#include <pthr_cgi.h>

cgi new_cgi (pool, http_request, io_handle);
vector cgi_params (cgi);
const char *cgi_param (cgi, const char *name);
const vector cgi_param_list (cgi, const char *name);
int cgi_erase (cgi, const char *name);
cgi copy_cgi (pool, cgi);

DESCRIPTION

new_cgi creates a new CGI object from an existing HTTP request. It reads the query string or POSTed parameters and parses them internally. CGI parameters are case sensitive, and multiple parameters may be passed with the same name. Parameter values are automatically unescaped by the library before you get to see them.
cgi_params returns a list of all the names of the parameters passed to the script. The list is returned as a vector of char *.
cgi_param returns the value of a single named CGI parameter, or NULL if there is no such parameter. If multiple parameters were given with the same name, this returns one of them, essentially at random.
cgi_param_list returns the list of values of the named CGI parameter. The list is returned as a vector of char *.
cgi_erase erases the named parameter. If a parameter was erased, this returns true, else this returns false.
copy_cgi copies cgi into pool pool.

AUTHOR

Richard Jones <rich@annexia.org>

LICENSE

GNU LGPL (see http://www.gnu.org/)

VERSION

pthrlib-3.0.3

SEE ALSO

cgi_get_post_max(3), cgi_escape(3), new_http_request(3).