cgi/cgi.h File Reference

CGI context handling functions. More...

#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_contextcgi_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.


Detailed Description

CGI context handling functions.

Author:
Vladimir Pavluk, 2006-2007
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 Documentation

typedef struct s_cgi_context t_cgi_context

CGI context type.

Working alias for s_cgi_context structure.


Function Documentation

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);

Parameters:
request a pointer to FCGI request (if in FastCGI mode). In CGI mode it should be NULL.
Returns:
pointer to created CGI context (t_cgi_context *).
See also:
cgi_context_free(t_cgi_context *ctx)

void cgi_context_free ( t_cgi_context ctx  ) 

Frees CGI context and releases all memory occupied by it.

Parameters:
ctx pointer to existing CGI context (t_cgi_context *).
See also:
cgi_context_create(FCGX_Request *request)

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).

Parameters:
ctx pointer to existing CGI context (t_cgi_context *).
name variable name.
Returns:
variable value (char *).
See also:
cgi_context_create(FCGX_Request *request)

cgi_context_free(t_cgi_context *ctx)


Variable Documentation

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.


Generated on Tue Jun 17 17:31:10 2008 for CGI Library by  doxygen 1.5.5