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