Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 53a6ca6ae0f1396eadc994002d93d490 > files > 4137

libmicrohttpd-doc-0.9.6-1.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>GNU libmicrohttpd: src/daemon/reason_phrase.c Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="../../main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="../../annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li><a href="../../dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="../../globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
  <div class="navpath">
    <ul>
      <li><a class="el" href="../../dir_6321990a7c24e6229efad5095602bf4d.html">src</a>      </li>
      <li><a class="el" href="../../dir_db71c89daadcbe4e293122b147fd6eef.html">daemon</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<h1>reason_phrase.c</h1>  </div>
</div>
<div class="contents">
<a href="../../dc/df0/reason__phrase_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">     This file is part of libmicrohttpd</span>
<a name="l00003"></a>00003 <span class="comment">     (C) 2007 Lymba</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">     This library is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment">     modify it under the terms of the GNU Lesser General Public</span>
<a name="l00007"></a>00007 <span class="comment">     License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment">     version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">     This library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">     but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00013"></a>00013 <span class="comment">     Lesser General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">     You should have received a copy of the GNU Lesser General Public</span>
<a name="l00016"></a>00016 <span class="comment">     License along with this library; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment">     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment">*/</span>
<a name="l00020"></a>00020 
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="../../de/d1b/reason__phrase_8h.html">reason_phrase.h</a>&quot;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef NULL</span>
<a name="l00031"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define NULL (void*)0</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#endif  // !NULL</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#a761446d4ae9f00516141943ff1d6349f">00034</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="../../dc/df0/reason__phrase_8c.html#a761446d4ae9f00516141943ff1d6349f">invalid_hundred</a>[] = { <a class="code" href="../../dc/df0/reason__phrase_8c.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> };
<a name="l00035"></a>00035 
<a name="l00036"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#a7822f5e013e48db41ac1f4a319466dab">00036</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="../../dc/df0/reason__phrase_8c.html#a7822f5e013e48db41ac1f4a319466dab">one_hundred</a>[] = {
<a name="l00037"></a>00037   <span class="stringliteral">&quot;Continue&quot;</span>,
<a name="l00038"></a>00038   <span class="stringliteral">&quot;Switching Protocols&quot;</span>,
<a name="l00039"></a>00039   <span class="stringliteral">&quot;Processing&quot;</span>
<a name="l00040"></a>00040 };
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#a5b391b9312084a79afeeb73e6387f6f1">00042</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="../../dc/df0/reason__phrase_8c.html#a5b391b9312084a79afeeb73e6387f6f1">two_hundred</a>[] = {
<a name="l00043"></a>00043   <span class="stringliteral">&quot;OK&quot;</span>,
<a name="l00044"></a>00044   <span class="stringliteral">&quot;Created&quot;</span>,
<a name="l00045"></a>00045   <span class="stringliteral">&quot;Accepted&quot;</span>,
<a name="l00046"></a>00046   <span class="stringliteral">&quot;Non-Authoritative Information&quot;</span>,
<a name="l00047"></a>00047   <span class="stringliteral">&quot;No Content&quot;</span>,
<a name="l00048"></a>00048   <span class="stringliteral">&quot;Reset Content&quot;</span>,
<a name="l00049"></a>00049   <span class="stringliteral">&quot;Partial Content&quot;</span>,
<a name="l00050"></a>00050   <span class="stringliteral">&quot;Multi Status&quot;</span>
<a name="l00051"></a>00051 };
<a name="l00052"></a>00052 
<a name="l00053"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#ab1734884605a250b3ea7e6161107fd40">00053</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="../../dc/df0/reason__phrase_8c.html#ab1734884605a250b3ea7e6161107fd40">three_hundred</a>[] = {
<a name="l00054"></a>00054   <span class="stringliteral">&quot;Multiple Choices&quot;</span>,
<a name="l00055"></a>00055   <span class="stringliteral">&quot;Moved Permanently&quot;</span>,
<a name="l00056"></a>00056   <span class="stringliteral">&quot;Moved Temporarily&quot;</span>,
<a name="l00057"></a>00057   <span class="stringliteral">&quot;See Other&quot;</span>,
<a name="l00058"></a>00058   <span class="stringliteral">&quot;Not Modified&quot;</span>,
<a name="l00059"></a>00059   <span class="stringliteral">&quot;Use Proxy&quot;</span>,
<a name="l00060"></a>00060   <span class="stringliteral">&quot;Switch Proxy&quot;</span>,
<a name="l00061"></a>00061   <span class="stringliteral">&quot;Temporary Redirect&quot;</span>
<a name="l00062"></a>00062 };
<a name="l00063"></a>00063 
<a name="l00064"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#ac2724302cdadb7f3de5f6e1e4b807805">00064</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="../../dc/df0/reason__phrase_8c.html#ac2724302cdadb7f3de5f6e1e4b807805">four_hundred</a>[] = {
<a name="l00065"></a>00065   <span class="stringliteral">&quot;Bad Request&quot;</span>,
<a name="l00066"></a>00066   <span class="stringliteral">&quot;Unauthorized&quot;</span>,
<a name="l00067"></a>00067   <span class="stringliteral">&quot;Payment Required&quot;</span>,
<a name="l00068"></a>00068   <span class="stringliteral">&quot;Forbidden&quot;</span>,
<a name="l00069"></a>00069   <span class="stringliteral">&quot;Not Found&quot;</span>,
<a name="l00070"></a>00070   <span class="stringliteral">&quot;Method Not Allowed&quot;</span>,
<a name="l00071"></a>00071   <span class="stringliteral">&quot;Not Acceptable&quot;</span>,
<a name="l00072"></a>00072   <span class="stringliteral">&quot;Proxy Authentication Required&quot;</span>,
<a name="l00073"></a>00073   <span class="stringliteral">&quot;Request Time-out&quot;</span>,
<a name="l00074"></a>00074   <span class="stringliteral">&quot;Conflict&quot;</span>,
<a name="l00075"></a>00075   <span class="stringliteral">&quot;Gone&quot;</span>,
<a name="l00076"></a>00076   <span class="stringliteral">&quot;Length Required&quot;</span>,
<a name="l00077"></a>00077   <span class="stringliteral">&quot;Precondition Failed&quot;</span>,
<a name="l00078"></a>00078   <span class="stringliteral">&quot;Request Entity Too Large&quot;</span>,
<a name="l00079"></a>00079   <span class="stringliteral">&quot;Request-URI Too Large&quot;</span>,
<a name="l00080"></a>00080   <span class="stringliteral">&quot;Unsupported Media Type&quot;</span>,
<a name="l00081"></a>00081   <span class="stringliteral">&quot;Requested Range Not Satisfiable&quot;</span>,
<a name="l00082"></a>00082   <span class="stringliteral">&quot;Expectation Failed&quot;</span>,
<a name="l00083"></a>00083   <span class="stringliteral">&quot;Unprocessable Entity&quot;</span>,
<a name="l00084"></a>00084   <span class="stringliteral">&quot;Locked&quot;</span>,
<a name="l00085"></a>00085   <span class="stringliteral">&quot;Failed Dependency&quot;</span>,
<a name="l00086"></a>00086   <span class="stringliteral">&quot;Unordered Collection&quot;</span>,
<a name="l00087"></a>00087   <span class="stringliteral">&quot;Upgrade Required&quot;</span>,
<a name="l00088"></a>00088   <span class="stringliteral">&quot;Retry With&quot;</span>
<a name="l00089"></a>00089 };
<a name="l00090"></a>00090 
<a name="l00091"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#a9c6fd5623f23219e1f80a40817ec321b">00091</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="../../dc/df0/reason__phrase_8c.html#a9c6fd5623f23219e1f80a40817ec321b">five_hundred</a>[] = {
<a name="l00092"></a>00092   <span class="stringliteral">&quot;Internal Server Error&quot;</span>,
<a name="l00093"></a>00093   <span class="stringliteral">&quot;Not Implemented&quot;</span>,
<a name="l00094"></a>00094   <span class="stringliteral">&quot;Bad Gateway&quot;</span>,
<a name="l00095"></a>00095   <span class="stringliteral">&quot;Service Unavailable&quot;</span>,
<a name="l00096"></a>00096   <span class="stringliteral">&quot;Gateway Time-out&quot;</span>,
<a name="l00097"></a>00097   <span class="stringliteral">&quot;HTTP Version not supported&quot;</span>,
<a name="l00098"></a>00098   <span class="stringliteral">&quot;Variant Also Negotiates&quot;</span>,
<a name="l00099"></a>00099   <span class="stringliteral">&quot;Insufficient Storage&quot;</span>,
<a name="l00100"></a>00100   <span class="stringliteral">&quot;Bandwidth Limit Exceeded&quot;</span>,
<a name="l00101"></a>00101   <span class="stringliteral">&quot;Not Extended&quot;</span>
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103 
<a name="l00104"></a>00104 
<a name="l00105"></a>00105 <span class="keyword">struct </span>MHD_Reason_Block
<a name="l00106"></a>00106 {
<a name="l00107"></a>00107   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max;
<a name="l00108"></a>00108   <span class="keyword">const</span> <span class="keywordtype">char</span> **data;
<a name="l00109"></a>00109 };
<a name="l00110"></a>00110 
<a name="l00111"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#a37645b10e3f56bd8fb00f5e2f49b9742">00111</a> <span class="preprocessor">#define BLOCK(m) { (sizeof(m) / sizeof(char*)), m }</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
<a name="l00113"></a><a class="code" href="../../dc/df0/reason__phrase_8c.html#a245eedeabde5065939828222e8d2b7b3">00113</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">struct </span>MHD_Reason_Block <a class="code" href="../../dc/df0/reason__phrase_8c.html#a245eedeabde5065939828222e8d2b7b3">reasons</a>[] = {
<a name="l00114"></a>00114   <a class="code" href="../../dc/df0/reason__phrase_8c.html#a37645b10e3f56bd8fb00f5e2f49b9742">BLOCK</a> (<a class="code" href="../../dc/df0/reason__phrase_8c.html#a761446d4ae9f00516141943ff1d6349f">invalid_hundred</a>),
<a name="l00115"></a>00115   <a class="code" href="../../dc/df0/reason__phrase_8c.html#a37645b10e3f56bd8fb00f5e2f49b9742">BLOCK</a> (<a class="code" href="../../dc/df0/reason__phrase_8c.html#a7822f5e013e48db41ac1f4a319466dab">one_hundred</a>),
<a name="l00116"></a>00116   <a class="code" href="../../dc/df0/reason__phrase_8c.html#a37645b10e3f56bd8fb00f5e2f49b9742">BLOCK</a> (<a class="code" href="../../dc/df0/reason__phrase_8c.html#a5b391b9312084a79afeeb73e6387f6f1">two_hundred</a>),
<a name="l00117"></a>00117   <a class="code" href="../../dc/df0/reason__phrase_8c.html#a37645b10e3f56bd8fb00f5e2f49b9742">BLOCK</a> (<a class="code" href="../../dc/df0/reason__phrase_8c.html#ab1734884605a250b3ea7e6161107fd40">three_hundred</a>),
<a name="l00118"></a>00118   <a class="code" href="../../dc/df0/reason__phrase_8c.html#a37645b10e3f56bd8fb00f5e2f49b9742">BLOCK</a> (<a class="code" href="../../dc/df0/reason__phrase_8c.html#ac2724302cdadb7f3de5f6e1e4b807805">four_hundred</a>),
<a name="l00119"></a>00119   <a class="code" href="../../dc/df0/reason__phrase_8c.html#a37645b10e3f56bd8fb00f5e2f49b9742">BLOCK</a> (<a class="code" href="../../dc/df0/reason__phrase_8c.html#a9c6fd5623f23219e1f80a40817ec321b">five_hundred</a>),
<a name="l00120"></a>00120 };
<a name="l00121"></a>00121 
<a name="l00122"></a>00122 <span class="keyword">const</span> <span class="keywordtype">char</span> *
<a name="l00123"></a><a class="code" href="../../de/d1b/reason__phrase_8h.html#aa451a3c3bd307214d6fa282f425b69fa">00123</a> <a class="code" href="../../dc/df0/reason__phrase_8c.html#aa451a3c3bd307214d6fa282f425b69fa">MHD_get_reason_phrase_for</a> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> code)
<a name="l00124"></a>00124 {
<a name="l00125"></a>00125   <span class="keywordflow">if</span> ((code &gt;= 100 &amp;&amp; code &lt; 600) &amp;&amp; (reasons[code / 100].max &gt; code % 100))
<a name="l00126"></a>00126     <span class="keywordflow">return</span> reasons[code / 100].data[code % 100];
<a name="l00127"></a>00127   <span class="keywordflow">return</span> <span class="stringliteral">&quot;Unknown&quot;</span>;
<a name="l00128"></a>00128 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Jan 26 2011 for GNU libmicrohttpd by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>