Main Page   Compound List   File List   Header Files   Sources   Compound Members   File Members  

cgiapi.c File Reference

CGIAPI - implementation. More...


Functions

unsigned int CGIInstall (CGI_Entry far* CGIEntry, char far* name, method_t method, void far* CGIFuncPt)
This function installs a CGI program (more exactly: a CGI function) in the memory. More...

unsigned int CGIRemove (CGI_Entry far* CGIEntry)
Function removes a CGI program (more exactly: a CGI function) from the memory. More...

void CGIResponse (rpCgiPtr CGIRequest, response_t responseCode, response_t responseType, char far* responseData, size_t length)
Function which fills the response parameter of a CGI funtion. More...

void CGIGetFirstFormItem (char far* argumentBuffer, FormItem far* firstFormItem)
This functions gets the first item from a form. More...

char far* CGIGetNextFormItem (char far* argumentBuffer, FormItem far** nextFormItem)
This functions gets the next (name,value) pair of a form. More...


Detailed Description

CGIAPI - implementation.

Author(s):
Christian Decker (cdecker@teco.edu)

Development System: Turbo C++ 3.0

Licence: GPL

This API was developed for easy handling the CGI functions of the SC12 from Beck GmbH. The code was inspired from a snippet which I found in the examples delivered with the original API descriptions from Beck.

This API contains functions for installing and removing a CGI program. Furthermore there are functions for reading the values of a and for password queries. Possibility for setting the right response struct (CGIRequest) is also given.

See also:
http://www.beck-ip.com/ , http://www.teco.edu/~cdecker/ , cdecker@teco.edu

Definition in file cgiapi.c.


Function Documentation

unsigned int CGIInstall (CGI_Entry far * CGIEntry, char far * name, method_t method, void far * CGIFuncPt)

This function installs a CGI program (more exactly: a CGI function) in the memory.

Parameters:
CGIEntry   is a far pointer to a CGI_Entry struct
name   is a symbolic name which identifies the CGI program
method   is one of CgiHttpGet, CgiHttpHead, CgiHttpPost
CGIFuncPt   is a far pointer to the function which handles the CGI call
Returns:
returns an errorcode
See also:
cgi.h

Definition at line 33 of file cgiapi.c.

unsigned int CGIRemove (CGI_Entry far * CGIEntry)

Function removes a CGI program (more exactly: a CGI function) from the memory.

Parameters:
CGIEntry   is a far pointer to a CGI_Entry struct
See also:
cgi.h

Definition at line 51 of file cgiapi.c.

void CGIResponse (rpCgiPtr CGIRequest, response_t responseCode, response_t responseType, char far * responseData, size_t length)

Function which fills the response parameter of a CGI funtion.

Parameters:
CGIRequest   is the pointer comming from the paramter list of the CGI func
responseCode   is a return Code from the CGI execution (e.g.CgiHttpOk)
responseType   is the content-type of the responseData
responseData   is a far pointer to the char buffer where the response is
length   is the length of the responseData
Returns:
returns an errorcode
See also:
cgi.h for responseCodes

Definition at line 64 of file cgiapi.c.

void CGIGetFirstFormItem (char far * argumentBuffer, FormItem far * firstFormItem)

This functions gets the first item from a form.

Parameters:
argumentBuffer   is a far pointer to the form data
firstFormItem   is a far pointer to the first (name,value) pair of a form

Definition at line 72 of file cgiapi.c.

char far * CGIGetNextFormItem (char far * argumentBuffer, FormItem far ** nextFormItem)

This functions gets the next (name,value) pair of a form.

The address of the FormItem struct is saved in nextFormItem. It returns a far pointer to part of the argumentBuffer where the (name,value) pair is located. You'll need this to check, whether there are more arguments. Call only after CGIGetFirstFormItem

Parameters:
argumentBuffer   is a far pointer to the form data
nextFormItem   is a far pointer to the next (name, value) pair of a form - it's NULL if there's no further pair.
Returns:
returns a far pointer to piece of mem where the (name,value) pair is located.
See also:
CGIGetFirstFormItem()

Definition at line 87 of file cgiapi.c.


Generated at Fri Jun 9 21:00:18 2000 for CGIAPI by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999