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