#include <stdio.h>
#include <cgi/cgi_config.h>
#include <cgi/cookies.h>
#include <cgi/headers.h>
#include <cgi/session.h>
#include <cgi/form.h>
Data Structures | |
| struct | s_cgi_context |
| CGI context structure. More... | |
Typedefs | |
| typedef struct s_cgi_context | t_cgi_context |
| CGI context type. | |
Functions | |
| t_cgi_context * | cgi_context_create (FCGX_Request *) |
| Create and initialize CGI context. | |
| void | cgi_context_free (t_cgi_context *) |
| Frees CGI context and releases all memory occupied by it. | |
| char * | cgi_getenv (t_cgi_context *, char *) |
| Get the value of environment variable. | |
Variables | |
| char * | __SELF__ |
| Current script name. | |
| char * | __SITE__ |
| Current site name. | |
CGI context is a context in which your CGI application will run. CGI context includes input/output stream handles, environment pointer, form data, cookies - in general, all CGI environment. This file contains functions to create and free CGI context.
| typedef struct s_cgi_context t_cgi_context |
CGI context type.
Working alias for s_cgi_context structure.
| t_cgi_context* cgi_context_create | ( | FCGX_Request * | request | ) |
Create and initialize CGI context.
There is no way to initialize CGI context from existing variable. There are two ways to create CGI context: for CGI application: t_cgi_context *cgi = cgi_context_create(NULL); for FastCGI application: t_cgi_context *cgi = cgi_context_create(req);
| request | a pointer to FCGI request (if in FastCGI mode). In CGI mode it should be NULL. |
| void cgi_context_free | ( | t_cgi_context * | ctx | ) |
Frees CGI context and releases all memory occupied by it.
| ctx | pointer to existing CGI context (t_cgi_context *). |
| char* cgi_getenv | ( | t_cgi_context * | ctx, | |
| char * | name | |||
| ) |
Get the value of environment variable.
Returns value of the given cookie. The returned string is not copied, so use it carefully (the best is to use it only for reading).
| ctx | pointer to existing CGI context (t_cgi_context *). | |
| name | variable name. |
| char* __SELF__ |
Current script name.
Pointer to the string containing the name of the current script.
| char* __SITE__ |
Current site name.
Pointer to the string containing the name of the current site.
1.5.5