forked from Imagelibrary/uip
175 lines
9.0 KiB
HTML
175 lines
9.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>uIP 0.9: Web server</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.3.3 -->
|
|
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
|
|
<h1>Web server<br>
|
|
<small>
|
|
[<a class="el" href="a00076.html">Example applications</a>]</small>
|
|
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
The uIP web server is a very simplistic implementation of an HTTP server. It can serve web pages and files from a read-only ROM filesystem, and provides a very small scripting language.<p>
|
|
The script language is very simple and works as follows. Each script line starts with a command character, either "i", "t", "c", "#" or ".". The "i" command tells the script interpreter to "include" a file from the virtual file system and output it to the web browser. The "t" command should be followed by a line of text that is to be output to the browser. The "c" command is used to call one of the C functions from the httpd-cgi.c file. A line that starts with a "#" is ignored (i.e., the "#" denotes a comment), and the "." denotes the last script line.<p>
|
|
The script that produces the file statistics page looks somewhat like this:<p>
|
|
<div class="fragment"><pre>i /header.html
|
|
t <h1>File statistics</h1><br><table width=<span class="stringliteral">"100%"</span>>
|
|
t <tr><td><a href=<span class="stringliteral">"/index.html"</span>>/index.html</a></td><td>
|
|
c a /index.html
|
|
t </td></tr> <tr><td><a href=<span class="stringliteral">"/cgi/files"</span>>/cgi/files</a></td><td>
|
|
c a /cgi/files
|
|
t </td></tr> <tr><td><a href=<span class="stringliteral">"/cgi/tcp"</span>>/cgi/tcp</a></td><td>
|
|
c a /cgi/tcp
|
|
t </td></tr> <tr><td><a href=<span class="stringliteral">"/404.html"</span>>/404.html</a></td><td>
|
|
c a /404.html
|
|
t </td></tr></table>
|
|
i /footer.plain
|
|
.
|
|
</pre></div>
|
|
<p>
|
|
<table border=0 cellpadding=0 cellspacing=0>
|
|
<tr><td></td></tr>
|
|
<tr><td colspan=2><br><h2>Files</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00049.html">cgi.c</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">HTTP server script language C functions file. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00050.html">cgi.h</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">HTTP script language header file. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00051.html">fs.c</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">HTTP server read-only file system code. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00052.html">fs.h</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">HTTP server read-only file system header file. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00053.html">httpd.c</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">HTTP server. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00054.html">httpd.h</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">HTTP server header file. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>struct </td><td class="memItemRight" valign=bottom><a class="el" href="a00030.html">fs_file</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">An open file in the read-only file system. </em> <a href="a00030.html#_details">More...</a><em><br><br></td></tr>
|
|
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a16">httpd_init</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the web server. </em> <a href="#a16"></a><em><br><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a23">fs_open</a> (const char *name, struct <a class="el" href="a00030.html">fs_file</a> *file)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Open a file in the read-only file system. </em> <a href="#a23"></a><em><br><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a24" doxytag="httpd::fs_init"></a>
|
|
void </td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a24">fs_init</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the read-only file system. <br><br></td></tr>
|
|
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a4" doxytag="httpd::cgitab"></a>
|
|
cgifunction </td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a4">cgitab</a> []</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">A table containing pointers to C functions that can be called from a web server script. <br><br></td></tr>
|
|
</table>
|
|
<hr><h2>Function Documentation</h2>
|
|
<a name="a23" doxytag="fs.h::fs_open"></a><p>
|
|
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top"> int fs_open </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">const char * </td>
|
|
<td class="mdname" nowrap> <em>name</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td></td>
|
|
<td class="md" nowrap>struct <a class="el" href="a00030.html">fs_file</a> * </td>
|
|
<td class="mdname" nowrap> <em>file</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Open a file in the read-only file system.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign=top><em>name</em> </td><td>The name of the file.</td></tr>
|
|
<tr><td valign=top><em>file</em> </td><td>The file pointer, which must be allocated by caller and will be filled in by the function. </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a16" doxytag="httpd.h::httpd_init"></a><p>
|
|
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top"> void httpd_init </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">void </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Initialize the web server.
|
|
<p>
|
|
Starts to listen for incoming connection requests on TCP port 80. </td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>
|
|
Here is the call graph for this function:<p><center><img src="a00098_a27_cgraph.png" border="0" usemap="#a00098_a27_cgraph_map" alt=""></center>
|
|
<map name="a00098_a27_cgraph_map">
|
|
<area href="a00098.html#a5" shape="rect" coords="144,6,189,27" alt="">
|
|
<area href="a00075.html#a25" shape="rect" coords="133,51,200,72" alt="">
|
|
</map>
|
|
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:50 2003 for uIP 0.9 by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
|
|
</a>1.3.3 </small></address>
|
|
</body>
|
|
</html>
|