]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/ColdFire_MCF52233_Eclipse/RTOSDemo/webserver/httpd-cgi.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / ColdFire_MCF52233_Eclipse / RTOSDemo / webserver / httpd-cgi.h
1 /**\r
2  * \addtogroup httpd\r
3  * @{\r
4  */\r
5 \r
6 /**\r
7  * \file\r
8  *         Web server script interface header file\r
9  * \author\r
10  *         Adam Dunkels <adam@sics.se>\r
11  *\r
12  */\r
13 \r
14 \r
15 \r
16 /*\r
17  * Copyright (c) 2001, Adam Dunkels.\r
18  * All rights reserved.\r
19  *\r
20  * Redistribution and use in source and binary forms, with or without\r
21  * modification, are permitted provided that the following conditions\r
22  * are met:\r
23  * 1. Redistributions of source code must retain the above copyright\r
24  *    notice, this list of conditions and the following disclaimer.\r
25  * 2. Redistributions in binary form must reproduce the above copyright\r
26  *    notice, this list of conditions and the following disclaimer in the\r
27  *    documentation and/or other materials provided with the distribution.\r
28  * 3. The name of the author may not be used to endorse or promote\r
29  *    products derived from this software without specific prior\r
30  *    written permission.\r
31  *\r
32  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS\r
33  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
34  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
35  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\r
36  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
37  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\r
38  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
39  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
40  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
41  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
42  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
43  *\r
44  * This file is part of the uIP TCP/IP stack.\r
45  *\r
46  * $Id: httpd-cgi.h,v 1.2 2006/06/11 21:46:38 adam Exp $\r
47  *\r
48  */\r
49 \r
50 #ifndef __HTTPD_CGI_H__\r
51 #define __HTTPD_CGI_H__\r
52 \r
53 #include "psock.h"\r
54 #include "httpd.h"\r
55 \r
56 typedef PT_THREAD((* httpd_cgifunction)(struct httpd_state *, char *));\r
57 \r
58 httpd_cgifunction httpd_cgi(char *name);\r
59 \r
60 struct httpd_cgi_call {\r
61   const char *name;\r
62   const httpd_cgifunction function;\r
63 };\r
64 \r
65 /**\r
66  * \brief      HTTPD CGI function declaration\r
67  * \param name The C variable name of the function\r
68  * \param str  The string name of the function, used in the script file\r
69  * \param function A pointer to the function that implements it\r
70  *\r
71  *             This macro is used for declaring a HTTPD CGI\r
72  *             function. This function is then added to the list of\r
73  *             HTTPD CGI functions with the httpd_cgi_add() function.\r
74  *\r
75  * \hideinitializer\r
76  */\r
77 #define HTTPD_CGI_CALL(name, str, function) \\r
78 static PT_THREAD(function(struct httpd_state *, char *)); \\r
79 static const struct httpd_cgi_call name = {str, function}\r
80 \r
81 void httpd_cgi_init(void);\r
82 #endif /* __HTTPD_CGI_H__ */\r
83 \r
84 /** @} */\r