00001 00016 /* 00017 * Copyright (c) 2001, Adam Dunkels. 00018 * All rights reserved. 00019 * 00020 * Redistribution and use in source and binary forms, with or without 00021 * modification, are permitted provided that the following conditions 00022 * are met: 00023 * 1. Redistributions of source code must retain the above copyright 00024 * notice, this list of conditions and the following disclaimer. 00025 * 2. Redistributions in binary form must reproduce the above copyright 00026 * notice, this list of conditions and the following disclaimer in the 00027 * documentation and/or other materials provided with the distribution. 00028 * 3. The name of the author may not be used to endorse or promote 00029 * products derived from this software without specific prior 00030 * written permission. 00031 * 00032 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 00033 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00034 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00035 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 00036 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00037 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00038 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00039 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00040 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00041 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00042 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00043 * 00044 * This file is part of the uIP TCP/IP stack. 00045 * 00046 * $Id: httpd-cgi.h,v 1.2 2006/06/11 21:46:38 adam Exp $ 00047 * 00048 */ 00049 00050 #ifndef __HTTPD_CGI_H__ 00051 #define __HTTPD_CGI_H__ 00052 00053 #include "psock.h" 00054 #include "httpd.h" 00055 00056 typedef PT_THREAD((* httpd_cgifunction)(struct httpd_state *, char *)); 00057 00058 httpd_cgifunction httpd_cgi(char *name); 00059 00060 struct httpd_cgi_call { 00061 const char *name; 00062 const httpd_cgifunction function; 00063 }; 00064 00077 #define HTTPD_CGI_CALL(name, str, function) \ 00078 static PT_THREAD(function(struct httpd_state *, char *)); \ 00079 static const struct httpd_cgi_call name = {str, function} 00080 00081 void httpd_cgi_init(void); 00082 void cgiProcessFormInput( char *pcInputString, int xInputLength ); 00083 #endif /* __HTTPD_CGI_H__ */ 00084