MityDSP Documentation Index

tsHttpdCgiTable Interface Reference

#include <lwip/httpd/httpd.h>

List of all members.

Public Attributes

tfHttpdCgiFunc func
const char * name

Detailed Description

This structure specifies the application specific CGI functions. The table will be filled in by the application and passed to tcHttpd::run() in the tsHttpdParams::cgi_table field. The table must contain one entry pair for each CGI function which the application provides.

Attention:
The last element of the array MUST contain two NULL pointers. The web server uses this as indication that it has reached the end of the table when looking up a CGI function.
See also:
tcHttpd::run

Example

The following example shows two CGI functions. The first function "Hello" will be invoked when the webserver loads a page which contains the tag string <%Hello%>. The second function "World" will be invoked when the webserver loads a page which contains the tag string <%World%>.

 tsHttpdCgiTable cgi_function_table[] = 
 {
     cgi_hello,  "Hello",           // <%Hello%> tag
     cgi_world,  "World",           // <%World%> tag
     NULL, NULL                     // End of table marker
 };

 void cgi_hello (tsHttpConn *httpconn)
 {
     const char str = "<B>Hello</B>";
     httpconn->httpd->html_write (httpconn, str, strlen (str));
 }

 void cgi_world (tsHttpConn *httpconn)
 {
     const char str = "<B>World!!!</B>";
     httpconn->httpd->html_write (httpconn, str, strlen (str));
 }

Member Data Documentation

Pointer to an application provided CGI function.

const char* tsHttpdCgiTable::name

The name of the CGI function as specified in the HTML code which references the function.


  
Generated on Fri Sep 23 16:34:02 2011 for MityDSP Net by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.