httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1329073 [2/2] - /httpd/httpd/trunk/docs/manual/developer/modguide.xml
Date Mon, 23 Apr 2012 05:51:55 GMT

Modified: httpd/httpd/trunk/docs/manual/developer/modguide.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/developer/modguide.xml?rev=1329073&r1=1329072&r2=1329073&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/developer/modguide.xml (original)
+++ httpd/httpd/trunk/docs/manual/developer/modguide.xml Mon Apr 23 05:51:55 2012
@@ -46,12 +46,14 @@ MD5 digest value of the file located at 
 http://www.example.com/index.html</code>, we would visit <code>
 http://www.example.com/index.html.sum</code>. 
 </p>
+
 <p>
 In the second part of this document, which deals with configuration 
 directive and context awareness, we will be looking at a module that simply 
 write out its own configuration to the client.
 </p>
 </section>
+
 <section id="prerequisites"><title>Prerequisites</title>
 <p>
 First and foremost, you are expected to have a basic knowledge of how the C 
@@ -83,27 +85,28 @@ apxs -i -a -c mod_example.c
 </section>
 
 <section id="basics"><title>Defining a module</title>
+<p>
 <img src="../images/build_a_mod_3.png" alt="Module name tags"/><br/>
-<p>Every module starts with the same declaration, or name tag if you will, 
-that defines a module as <em>a separate entity within Apache</em>:
+Every module starts with the same declaration, or name tag if you will, 
+that defines a module as <em>a separate entity within Apache</em>:</p>
 
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-module AP_MODULE_DECLARE_DATA   example_module <code style='color:#806030; '>=</code>
-<code style='color:#806030; '>{</code>
-    STANDARD20_MODULE_STUFF<code style='color:#806030; '>,</code>
-    create_dir_conf<code style='color:#806030; '>,</code> <code style='color:#c34e00; '>/* Per-directory configuration handler */</code>
-    merge_dir_conf<code style='color:#806030; '>,</code>  <code style='color:#c34e00; '>/* Merge handler for per-directory configurations */</code>
-    create_svr_conf<code style='color:#806030; '>,</code> <code style='color:#c34e00; '>/* Per-server configuration handler */</code>
-    merge_svr_conf<code style='color:#806030; '>,</code>  <code style='color:#c34e00; '>/* Merge handler for per-server configurations */</code>
-    directives<code style='color:#806030; '>,</code>      <code style='color:#c34e00; '>/* Any directives we may have for httpd */</code>
-    register_hooks   <code style='color:#c34e00; '>/* Our hook registering function */</code>
-<code style='color:#806030; '>}</code><code style='color:#806030; '>;</code>
-</pre>
+<p class="source">
+module AP_MODULE_DECLARE_DATA   example_module <code class="sh_misc">=</code>
+<code class="sh_misc">{</code>
+    STANDARD20_MODULE_STUFF<code class="sh_misc">,</code>
+    create_dir_conf<code class="sh_misc">,</code> <code class="sh_comment">/* Per-directory configuration handler */</code>
+    merge_dir_conf<code class="sh_misc">,</code>  <code class="sh_comment">/* Merge handler for per-directory configurations */</code>
+    create_svr_conf<code class="sh_misc">,</code> <code class="sh_comment">/* Per-server configuration handler */</code>
+    merge_svr_conf<code class="sh_misc">,</code>  <code class="sh_comment">/* Merge handler for per-server configurations */</code>
+    directives<code class="sh_misc">,</code>      <code class="sh_comment">/* Any directives we may have for httpd */</code>
+    register_hooks   <code class="sh_comment">/* Our hook registering function */</code>
+<code class="sh_misc">}</code><code class="sh_misc">;</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 This bit of code lets the server know that we have now registered a new module 
 in the system, and that its name is <code>example_module</code>. The name 
 of the module is used primarily for two things:<br/>
@@ -177,46 +180,47 @@ the server based on the value of this ta
 To begin with, we only want to create a simple handler, that replies to the 
 client browser when a specific URL is requested, so we won't bother setting 
 up configuration handlers and directives just yet. Our initial module 
-definition will look like this:<br/>
+definition will look like this:</p>
 
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
+<p class="source">
 module AP_MODULE_DECLARE_DATA   example_module =
 {
     STANDARD20_MODULE_STUFF,
-    <code style='color:#7f0055; font-weight:bold; '>NULL</code>,
-    <code style='color:#7f0055; font-weight:bold; '>NULL</code>,
-    <code style='color:#7f0055; font-weight:bold; '>NULL</code>,
-    <code style='color:#7f0055; font-weight:bold; '>NULL</code>,
-    <code style='color:#7f0055; font-weight:bold; '>NULL</code>,
-    <code style='color:#800040; '>register_hooks</code>   <code style='color:#c34e00; '><code style='color:#c34e00; '>/* Our hook registering function */</code></code>
+    <code class="sh_constant">NULL</code>,
+    <code class="sh_constant">NULL</code>,
+    <code class="sh_constant">NULL</code>,
+    <code class="sh_constant">NULL</code>,
+    <code class="sh_constant">NULL</code>,
+    <code class="sh_function">register_hooks</code>   <code class="sh_comment"><code class="sh_comment">/* Our hook registering function */</code></code>
 };
-</pre>
+</p>
 <!-- END EXAMPLE CODE -->
 
 
-This lets the server know that we are not interesting in anything fancy, we 
+<p>This lets the server know that we are not interesting in anything fancy, we 
 just want to hook onto the requests and possibly handle some of them. </p> 
+
 <p> The reference in our example declaration, <code>register_hooks</code> 
 is the name of a function we will create to manage how we hook onto the 
 request process. In this example module, the function has just one purpose; 
 To create a simple hook that gets called after all the rewrites, access 
 control etc has been handled. Thus, we will let the server know, that we want 
 to hook into its process as one of the last modules: 
-
+</p>
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>static</code> <code style='color:#400000; font-weight:bold; '>void</code> register_hooks<code style='color:#806030; '>(</code>apr_pool_t <code style='color:#806030; '>*</code>pool<code style='color:#806030; '>)</code>
-<code style='color:#806030; '>{</code>
-    <code style='color:#c34e00; '>/* Create a hook in the request handler, so we get called when a request arrives */</code>
-    <code style='color:#800040; '>ap_hook_handler</code><code style='color:#806030; '>(</code>example_handler<code style='color:#806030; '>,</code> <code style='color:#7f0055; font-weight:bold; '>NULL</code><code style='color:#806030; '>,</code> <code style='color:#7f0055; font-weight:bold; '>NULL</code><code style='color:#806030; '>,</code> APR_HOOK_LAST<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-<code style='color:#806030; '>}</code>
-</pre>
+<p class="source">
+<code class="sh_declare">static</code> <code class="sh_declare">void</code> register_hooks<code class="sh_misc">(</code>apr_pool_t <code class="sh_misc">*</code>pool<code class="sh_misc">)</code>
+<code class="sh_misc">{</code>
+    <code class="sh_comment">/* Create a hook in the request handler, so we get called when a request arrives */</code>
+    <code class="sh_function">ap_hook_handler</code><code class="sh_misc">(</code>example_handler<code class="sh_misc">,</code> <code class="sh_constant">NULL</code><code class="sh_misc">,</code> <code class="sh_constant">NULL</code><code class="sh_misc">,</code> APR_HOOK_LAST<code class="sh_misc">)</code><code class="sh_misc">;</code>
+<code class="sh_misc">}</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 The <code>example_handler</code> reference is the function that will handle 
 the request. We will discuss how to create a handler in the next chapter.
 </p>
@@ -225,13 +229,14 @@ the request. We will discuss how to crea
 <p>
 Hooking into the request handling phase is but one of many hooks that you 
 can create. Some other ways of hooking are:
+</p>
 <ul>
 <li><code>ap_hook_child_init</code>: Place a hook that executes when a child process is spawned (commonly used for initializing modules after the server has forked)</li>
 <li><code>ap_hook_pre_config</code>: Place a hook that executes before any configuration data has been read (very early hook)</li>
 <li><code>ap_hook_post_config</code>: Place a hook that executes after configuration has been parsed, but before the server has forked</li>
 <li><code>ap_hook_translate_name</code>: Place a hook that executes when a URI needs to be translated into a filename on the server (think <code>mod_rewrite</code>)</li>
 </ul>
-</p>
+
 </section>
 </section>
 
@@ -244,103 +249,110 @@ request and so on), and is put in charge
 not interested in the request or handle the request with the tools provided.
 </p>
 <section id="simple_handler"><title>A simple &quot;Hello, world!&quot; 
-handler</title> Let's start off by making a very simple request handler 
-that does the following: <br/>
+handler</title> 
+<p>Let's start off by making a very simple request handler 
+that does the following:
+</p>
 <ol>
 <li>Check that this is a request that should be served by &quot;example-handler&quot;</li>
 <li>Set the content type of our output to <code>text/html</code></li>
 <li>Write &quot;Hello, world!&quot; back to the client browser</li>
 <li>Let the server know that we took care of this request and everything went fine</li>
 </ol>
-In C code, our example handler will now look like this:<br/>
-
+<p>
+In C code, our example handler will now look like this:
+</p>
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>static</code> <code style='color:#400000; font-weight:bold; '>int</code> example_handler<code style='color:#806030; '>(</code>request_rec <code style='color:#806030; '>*</code>r<code style='color:#806030; '>)</code>
-<code style='color:#806030; '>{</code>
-    <code style='color:#c34e00; '>/* First off, we need to check if this is a call for the "example-handler" handler.</code>
-<code style='color:#c34e00; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* If it is, we accept it and do our things, if not, we simply return DECLINED,</code>
-<code style='color:#c34e00; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* and the server will try somewhere else.</code>
-<code style='color:#c34e00; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*/</code>
-    <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code><code style='color:#806030; '>!</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>handler</code> <code style='color:#806030; '>|</code><code style='color:#806030; '>|</code> <code style='color:#800040; '>strcmp</code><code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>handler</code><code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>example-handler</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>)</code> <code style='color:#400000; font-weight:bold; '>return</code> <code style='color:#806030; '>(</code>DECLINED<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* Now that we are handling this request, we'll write out "Hello, world!" to the client.</code>
-<code style='color:#c34e00; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* To do so, we must first set the appropriate content type, followed by our output.</code>
-<code style='color:#c34e00; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*/</code>
-    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#gaa2f8412c400197338ec509f4a45e4579">ap_set_content_type</a><code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>text/html</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a><code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>Hello, world!</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* Lastly, we must tell the server that we took care of this request and everything went fine.</code>
-<code style='color:#c34e00; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* We do so by simply returning the value OK to the server.</code>
-<code style='color:#c34e00; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*/</code>
-    <code style='color:#400000; font-weight:bold; '>return</code> OK<code style='color:#806030; '>;</code>
-<code style='color:#806030; '>}</code>
-</pre>
+<p class="source">
+<code class="sh_declare">static</code> <code class="sh_declare">int</code> example_handler<code class="sh_misc">(</code>request_rec <code class="sh_misc">*</code>r<code class="sh_misc">)</code>
+<code class="sh_misc">{</code>
+    <code class="sh_comment">/* First off, we need to check if this is a call for the "example-handler" handler.</code>
+<code class="sh_comment">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* If it is, we accept it and do our things, if not, we simply return DECLINED,</code>
+<code class="sh_comment">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* and the server will try somewhere else.</code>
+<code class="sh_comment">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*/</code>
+    <code class="sh_declare">if</code> <code class="sh_misc">(</code><code class="sh_misc">!</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">handler</code> <code class="sh_misc">|</code><code class="sh_misc">|</code> <code class="sh_function">strcmp</code><code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">handler</code><code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">example-handler</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">)</code> <code class="sh_declare">return</code> <code class="sh_misc">(</code>DECLINED<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    
+    <code class="sh_comment">/* Now that we are handling this request, we'll write out "Hello, world!" to the client.</code>
+<code class="sh_comment">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* To do so, we must first set the appropriate content type, followed by our output.</code>
+<code class="sh_comment">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*/</code>
+    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#gaa2f8412c400197338ec509f4a45e4579">ap_set_content_type</a><code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">text/html</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a><code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">Hello, world!</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    
+    <code class="sh_comment">/* Lastly, we must tell the server that we took care of this request and everything went fine.</code>
+<code class="sh_comment">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* We do so by simply returning the value OK to the server.</code>
+<code class="sh_comment">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*/</code>
+    <code class="sh_declare">return</code> OK<code class="sh_misc">;</code>
+<code class="sh_misc">}</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 Now, we put all we have learned together and end up with a program that 
 looks like 
 <a href="http://people.apache.org/~humbedooh/mods/examples/mod_example_1.c">mod_example_1.c</a>
 . The functions used in this example will be explained later in the section 
-<a href= "#functions">&quot;Some useful functions you should know&quot;</a>
-. </section> <section id="request_rec"><title>The request_rec structure 
-</title> <p>The most essential part of any request is the <em>request record
+<a href= "#functions">&quot;Some useful functions you should know&quot;</a>. 
+</p>
+</section> 
+<section id="request_rec"><title>The request_rec structure</title> 
+<p>The most essential part of any request is the <em>request record
 </em>. In a call to a handler function, this is represented by the <code>
 request_req* </code> structure passed along with every call that is made. 
 This struct, typically just refered to as <code>r</code> in modules, 
 contains all the information you need for your module to fully process any 
 HTTP request and respond accordingly.</p> <p>Some key elements of the <code>
 request_req </code> structure are:
+</p>
 <ul>
-<li><code><code style='color:#008833'>r-&gt;handler</code> (char*)</code>: Contains the name of the handler the server is currently asking to do the handling of this request</li>
-<li><code><code style='color:#008833'>r-&gt;method</code> (char*)</code>: Contains the HTTP method being used, f.x. GET or POST</li>
-<li><code><code style='color:#008833'>r-&gt;filename</code> (char*)</code>: Contains the translated filename the client is requesting</li>
-<li><code><code style='color:#008833'>r-&gt;args</code> (char*)</code>: Contains the query string of the request, if any</li>
-<li><code><code style='color:#008833'>r-&gt;headers_in</code> (apr_table_t*)</code>: Contains all the headers sent by the client</li>
-<li><code><code style='color:#008833'>r-&gt;connection</code> (conn_rec*)</code>: A record containing information about the current connection</li>
-<li><code><code style='color:#008833'>r-&gt;useragent_ip</code> (char*)</code>: The IP address of the client connecting to us</li>
-<li><code><code style='color:#008833'>r-&gt;pool</code> (apr_pool_t*)</code>: The memory pool of this request. We'll discuss this in the &quot;
+<li><code><code class="sh_subobject">r-&gt;handler</code> (char*)</code>: Contains the name of the handler the server is currently asking to do the handling of this request</li>
+<li><code><code class="sh_subobject">r-&gt;method</code> (char*)</code>: Contains the HTTP method being used, f.x. GET or POST</li>
+<li><code><code class="sh_subobject">r-&gt;filename</code> (char*)</code>: Contains the translated filename the client is requesting</li>
+<li><code><code class="sh_subobject">r-&gt;args</code> (char*)</code>: Contains the query string of the request, if any</li>
+<li><code><code class="sh_subobject">r-&gt;headers_in</code> (apr_table_t*)</code>: Contains all the headers sent by the client</li>
+<li><code><code class="sh_subobject">r-&gt;connection</code> (conn_rec*)</code>: A record containing information about the current connection</li>
+<li><code><code class="sh_subobject">r-&gt;useragent_ip</code> (char*)</code>: The IP address of the client connecting to us</li>
+<li><code><code class="sh_subobject">r-&gt;pool</code> (apr_pool_t*)</code>: The memory pool of this request. We'll discuss this in the &quot;
 <a href="#memory">Memory management</a>&quot; chapter.</li>
 </ul>
+<p>
 A complete list of all the values contained with in the <code>request_req</code> structure can be found in 
 the <a href="http://svn.apache.org/repos/asf/httpd/httpd/trunk/include/httpd.h"><code>httpd.h</code></a> header 
 file or at <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/structrequest__rec.html">http://ci.apache.org/projects/httpd/trunk/doxygen/structrequest__rec.html</a>.
 </p>
+
+
 <p>
 Let's try out some of these variables in another example handler:<br/>
-
+</p>
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>static</code> <code style='color:#400000; font-weight:bold; '>int</code> example_handler<code style='color:#806030; '>(</code>request_rec <code style='color:#806030; '>*</code>r<code style='color:#806030; '>)</code>
-<code style='color:#806030; '>{</code>
-    <code style='color:#c34e00; '>/* Set the appropriate content type */</code>
-    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#gaa2f8412c400197338ec509f4a45e4579">ap_set_content_type</a><code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>text/html</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-
-    <code style='color:#c34e00; '>/* Print out the IP address of the client connecting to us: */</code>
-    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a><code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;h2>Hello, </code><code style='color:#0f6900; '>%s</code><code style='color:#e60000; '>!&lt;/h2></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>useragent_ip</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* If we were reached through a GET or a POST request, be happy, else sad. */</code>
-    <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code> <code style='color:#806030; '>!</code><code style='color:#800040; '>strcmp</code><code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>method</code><code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>POST</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code> <code style='color:#806030; '>|</code><code style='color:#806030; '>|</code> <code style='color:#806030; '>!</code><code style='color:#800040; '>strcmp</code><code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>method</code><code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>GET</code><code style='color:#80000
 0; '>"</code><code style='color:#806030; '>)</code> <code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-        ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>You used a GET or a POST method, that makes us happy!&lt;br></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#806030; '>}</code>
-    <code style='color:#400000; font-weight:bold; '>else</code> <code style='color:#806030; '>{</code>
-        ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>You did not use POST or GET, that makes us sad :(&lt;br></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#806030; '>}</code>
-
-    <code style='color:#c34e00; '>/* Lastly, if there was a query string, let's print that too! */</code>
-    <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>args</code><code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-        <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a><code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>Your query string was: </code><code style='color:#0f6900; '>%s</code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>args</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#806030; '>}</code>
-    <code style='color:#400000; font-weight:bold; '>return</code> OK<code style='color:#806030; '>;</code>
-<code style='color:#806030; '>}</code>
-</pre>
+<p class="source">
+<code class="sh_declare">static</code> <code class="sh_declare">int</code> example_handler<code class="sh_misc">(</code>request_rec <code class="sh_misc">*</code>r<code class="sh_misc">)</code>
+<code class="sh_misc">{</code>
+    <code class="sh_comment">/* Set the appropriate content type */</code>
+    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#gaa2f8412c400197338ec509f4a45e4579">ap_set_content_type</a><code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">text/html</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+
+    <code class="sh_comment">/* Print out the IP address of the client connecting to us: */</code>
+    <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a><code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">&lt;h2>Hello, </code><code class="sh_reference">%s</code><code class="sh_value">!&lt;/h2></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">useragent_ip</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    
+    <code class="sh_comment">/* If we were reached through a GET or a POST request, be happy, else sad. */</code>
+    <code class="sh_declare">if</code> <code class="sh_misc">(</code> <code class="sh_misc">!</code><code class="sh_function">strcmp</code><code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">method</code><code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">POST</code><code class="sh_character">"</code><code class="sh_misc">)</code> <code class="sh_misc">|</code><code class="sh_misc">|</code> <code class="sh_misc">!</code><code class="sh_function">strcmp</code><code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">method</code><code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">GET</code><code class="sh_character">"</code><code class="sh_misc">)</code> <code class="sh_misc">)</code> <code class="sh_misc">{</code>
+        ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">You used a GET or a POST method, that makes us happy!&lt;br></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_misc">}</code>
+    <code class="sh_declare">else</code> <code class="sh_misc">{</code>
+        ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">You did not use POST or GET, that makes us sad :(&lt;br></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_misc">}</code>
+
+    <code class="sh_comment">/* Lastly, if there was a query string, let's print that too! */</code>
+    <code class="sh_declare">if</code> <code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">args</code><code class="sh_misc">)</code> <code class="sh_misc">{</code>
+        <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a><code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">Your query string was: </code><code class="sh_reference">%s</code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">args</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_misc">}</code>
+    <code class="sh_declare">return</code> OK<code class="sh_misc">;</code>
+<code class="sh_misc">}</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
-</p>
 </section>
 
 <section id="return_value"><title>Return values</title>
@@ -351,19 +363,19 @@ module is not interested in handling a s
 return the value <code>DECLINED</code>. If it is handling a request, it 
 should either return the generic value <code>OK</code>, or a specific HTTP 
 status code, for example:
-
+</p>
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>static</code> <code style='color:#400000; font-weight:bold; '>int</code> example_handler<code style='color:#806030; '>(</code>request_rec <code style='color:#806030; '>*</code>r<code style='color:#806030; '>)</code>
-<code style='color:#806030; '>{</code>
-    <code style='color:#c34e00; '>/* Return 404: Not found */</code>
-    <code style='color:#400000; font-weight:bold; '>return</code> HTTP_NOT_FOUND<code style='color:#806030; '>;</code>
-<code style='color:#806030; '>}</code>
-</pre>
+<p class="source">
+<code class="sh_declare">static</code> <code class="sh_declare">int</code> example_handler<code class="sh_misc">(</code>request_rec <code class="sh_misc">*</code>r<code class="sh_misc">)</code>
+<code class="sh_misc">{</code>
+    <code class="sh_comment">/* Return 404: Not found */</code>
+    <code class="sh_declare">return</code> HTTP_NOT_FOUND<code class="sh_misc">;</code>
+<code class="sh_misc">}</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 Returning <code>OK</code> or a HTTP status code does not necessarily mean 
 that the request will end. The server may still have other handlers that are 
 interested in this request, for instance the logging modules which, upon a 
@@ -374,12 +386,15 @@ know that it should cease all activity o
 the next, without informing other handlers.
 <br/>
 <strong>General response codes:</strong>
+</p>
 <ul>
 <li><code>DECLINED</code>: We are not handling this request</li>
 <li><code>OK</code>: We handled this request and it went well</li>
 <li><code>DONE</code>: We handled this request and the server should just close this thread without further processing</li>
-</ul><br/>
+</ul>
+<p>
 <strong>HTTP specific return codes (excerpt):</strong>
+</p>
 <ul>
 <li><code>HTTP_OK (200)</code>: Request was okay</li>
 <li><code>HTTP_MOVED_PERMANENTLY (301)</code>: The resource has moved to a new URL</li>
@@ -388,7 +403,6 @@ the next, without informing other handle
 <li><code>HTTP_NOT_FOUND (404)</code>: File not found</li>
 <li><code>HTTP_INTERNAL_SERVER_ERROR (500)</code>: Internal server error (self explanatory)</li>
 </ul>
-</p>
 </section>
 
 <section id="functions"><title>Some useful functions you should know</title>
@@ -402,7 +416,7 @@ the next, without informing other handle
     
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>Hello, world!</code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code></pre>
+<p class="source">ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">Hello, world!</code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code></p>
 <!-- END EXAMPLE CODE -->
 
 
@@ -414,7 +428,7 @@ the next, without informing other handle
     
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'><code style='color:#2e8800; '><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a></code><code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>Hello, </code><code style='color:#0f6900; '>%s</code><code style='color:#e60000; '>!</code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>useragent_ip</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code></pre>
+<p class="source"><code class="sh_declare"><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#ga5e91eb6ca777c9a427b2e82bf1eeb81d">ap_rprintf</a></code><code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">Hello, </code><code class="sh_reference">%s</code><code class="sh_value">!</code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">useragent_ip</code><code class="sh_misc">)</code><code class="sh_misc">;</code></p>
 <!-- END EXAMPLE CODE -->
 
 </li>
@@ -425,7 +439,7 @@ the next, without informing other handle
     
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'><code style='color:#2e8800; '><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#gaa2f8412c400197338ec509f4a45e4579">ap_set_content_type</a></code><code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>text/plain</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code> <code style='color:#c34e00; '>/* force a raw text output */</code></pre>
+<p class="source"><code class="sh_declare"><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__PROTO.html#gaa2f8412c400197338ec509f4a45e4579">ap_set_content_type</a></code><code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">text/plain</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">;</code> <code class="sh_comment">/* force a raw text output */</code></p>
 <!-- END EXAMPLE CODE -->
 
 </li>
@@ -446,9 +460,10 @@ clean up after yourself - pretty neat, h
 
 <p>
 In our module, we will primarily be allocating memory for each request, so 
-it's appropriate to use the <code style='color:#008833'>r-&gt;pool</code> 
+it's appropriate to use the <code class="sh_subobject">r-&gt;pool</code> 
 reference when creating new objects. A few of the functions for allocating 
 memory within a pool are:
+</p>
 <ul>
 <li><code>void* <a href="http://apr.apache.org/docs/apr/1.4/group__apr__pools.html#ga85f1e193c31d109affda72f9a92c6915">apr_palloc</a>(
 apr_pool_t *p, apr_size_t size)</code>: Allocates <code>size</code> number of bytes in the pool for you</li>
@@ -458,52 +473,54 @@ apr_pool_t *p, apr_size_t size)</code>: 
 apr_pool_t *p, const char *s)</code>: Creates a duplicate of the string <code>s</code>. This is useful for copying constant values so you can edit them</li>
 <li><code>char* <a href="http://apr.apache.org/docs/apr/1.4/group__apr__strings.html#ga3eca76b8d293c5c3f8021e45eda813d8">apr_psprintf</a>(
 apr_pool_t *p, const char *fmt, ...)</code>: Similar to <code>sprintf</code>, except the server supplies you with an appropriately allocated target variable</li>
-
 </ul>
-Let's put these functions into an example handler:<br/>
+
+<p>Let's put these functions into an example handler:</p>
 
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>static</code> <code style='color:#400000; font-weight:bold; '>int</code> example_handler<code style='color:#806030; '>(</code>request_rec <code style='color:#806030; '>*</code>r<code style='color:#806030; '>)</code>
-<code style='color:#806030; '>{</code>
-    <code style='color:#400000; font-weight:bold; '>const</code> <code style='color:#400000; font-weight:bold; '>char</code><code style='color:#806030; '>*</code> original <code style='color:#806030; '>=</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>You can't edit this!</code><code style='color:#800000; '>"</code><code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>char</code><code style='color:#806030; '>*</code> copy<code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>int</code><code style='color:#806030; '>*</code> integers<code style='color:#806030; '>;</code>
+<p class="source">
+<code class="sh_declare">static</code> <code class="sh_declare">int</code> example_handler<code class="sh_misc">(</code>request_rec <code class="sh_misc">*</code>r<code class="sh_misc">)</code>
+<code class="sh_misc">{</code>
+    <code class="sh_declare">const</code> <code class="sh_declare">char</code><code class="sh_misc">*</code> original <code class="sh_misc">=</code> <code class="sh_character">"</code><code class="sh_value">You can't edit this!</code><code class="sh_character">"</code><code class="sh_misc">;</code>
+    <code class="sh_declare">char</code><code class="sh_misc">*</code> copy<code class="sh_misc">;</code>
+    <code class="sh_declare">int</code><code class="sh_misc">*</code> integers<code class="sh_misc">;</code>
     
-    <code style='color:#c34e00; '>/* Allocate space for 10 integer values and set them all to zero. */</code>
-    integers <code style='color:#806030; '>=</code> apr_pcalloc<code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code>pool<code style='color:#806030; '>,</code> <code style='color:#400000; font-weight:bold; '>sizeof</code><code style='color:#806030; '>(</code><code style='color:#400000; font-weight:bold; '>int</code><code style='color:#806030; '>)</code><code style='color:#806030; '>*</code><code style='color:#c00000; '>10</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code> 
+    <code class="sh_comment">/* Allocate space for 10 integer values and set them all to zero. */</code>
+    integers <code class="sh_misc">=</code> apr_pcalloc<code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code>pool<code class="sh_misc">,</code> <code class="sh_declare">sizeof</code><code class="sh_misc">(</code><code class="sh_declare">int</code><code class="sh_misc">)</code><code class="sh_misc">*</code><code class="sh_reference">10</code><code class="sh_misc">)</code><code class="sh_misc">;</code> 
     
-    <code style='color:#c34e00; '>/* Create a copy of the 'original' variable that we can edit. */</code>
-    copy <code style='color:#806030; '>=</code> apr_pstrdup<code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code>pool<code style='color:#806030; '>,</code> original<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>return</code> OK<code style='color:#806030; '>;</code>
-<code style='color:#806030; '>}</code>
-</pre>
+    <code class="sh_comment">/* Create a copy of the 'original' variable that we can edit. */</code>
+    copy <code class="sh_misc">=</code> apr_pstrdup<code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code>pool<code class="sh_misc">,</code> original<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_declare">return</code> OK<code class="sh_misc">;</code>
+<code class="sh_misc">}</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
+<p>
 This is all well and good for our module, which won't need any 
 pre-initialized variables or structures. However, if we wanted to 
 initialize something early on, before the requests come rolling in, we 
 could simply add a call to a function in our <code>register_hooks</code> 
 function to sort it out:
+</p>
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>static</code> <code style='color:#400000; font-weight:bold; '>void</code> register_hooks<code style='color:#806030; '>(</code>apr_pool_t <code style='color:#806030; '>*</code>pool<code style='color:#806030; '>)</code>
-<code style='color:#806030; '>{</code>
-    <code style='color:#c34e00; '>/* Call a function that initializes some stuff */</code>
-    <code style='color:#800040; '>example_init_function</code><code style='color:#806030; '>(</code>pool<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#c34e00; '>/* Create a hook in the request handler, so we get called when a request arrives */</code>
-    <code style='color:#800040; '>ap_hook_handler</code><code style='color:#806030; '>(</code>example_handler<code style='color:#806030; '>,</code> <code style='color:#7f0055; font-weight:bold; '>NULL</code><code style='color:#806030; '>,</code> <code style='color:#7f0055; font-weight:bold; '>NULL</code><code style='color:#806030; '>,</code> APR_HOOK_LAST<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-<code style='color:#806030; '>}</code>
-</pre>
+<p class="source">
+<code class="sh_declare">static</code> <code class="sh_declare">void</code> register_hooks<code class="sh_misc">(</code>apr_pool_t <code class="sh_misc">*</code>pool<code class="sh_misc">)</code>
+<code class="sh_misc">{</code>
+    <code class="sh_comment">/* Call a function that initializes some stuff */</code>
+    <code class="sh_function">example_init_function</code><code class="sh_misc">(</code>pool<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_comment">/* Create a hook in the request handler, so we get called when a request arrives */</code>
+    <code class="sh_function">ap_hook_handler</code><code class="sh_misc">(</code>example_handler<code class="sh_misc">,</code> <code class="sh_constant">NULL</code><code class="sh_misc">,</code> <code class="sh_constant">NULL</code><code class="sh_misc">,</code> APR_HOOK_LAST<code class="sh_misc">)</code><code class="sh_misc">;</code>
+<code class="sh_misc">}</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
+<p>
 In this pre-request initialization function we would not be using the 
 same pool as we did when allocating resources for request-based functions. 
 Instead, we would use the pool given to us by the server for allocating memory 
 on a per-process based level.
-
 </p>
 </section>
 
@@ -522,38 +539,39 @@ digest.
 <p>
 Since the introduction of Apache HTTP Server 2.4, parsing request data from GET and 
 POST requests have never been easier. All we require to parse both GET and 
-POST data is four simple lines: 
+POST data is four simple lines:
+</p> 
 
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
+<p class="source">
 <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__apr__tables.html#gad7ea82d6608a4a633fc3775694ab71e4">apr_table_t</a> *GET;
 <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/structapr__array__header__t.html">apr_array_header_t</a> *POST;
 
 <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#gaed25877b529623a4d8f99f819ba1b7bd">ap_args_to_table</a>(r, &amp;GET);
-<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__DAEMON.html#ga9d426b6382b49754d4f87c55f65af202">ap_parse_form_data</a>(r, <code style='color:#7f0055; font-weight:bold; '>NULL</code>, &amp;POST, -1, 8192);
-</pre>
+<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__DAEMON.html#ga9d426b6382b49754d4f87c55f65af202">ap_parse_form_data</a>(r, <code class="sh_constant">NULL</code>, &amp;POST, -1, 8192);
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 In our specific example module, we're looking for the <code>digest</code> 
 value from the query string, which now resides inside a table called <code>
 GET</code>. To extract this value, we need only perform a simple operation:
-<br/>
+</p>
 
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#c34e00; '>/* Get the "digest" key from the query string, if any. */</code>
-<code style='color:#400000; font-weight:bold; '>const</code> <code style='color:#400000; font-weight:bold; '>char</code><code style='color:#806030; '> *</code>digestType <code style='color:#806030; '>=</code> <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__apr__tables.html#ga4db13e3915c6b9a3142b175d4c15d915">apr_table_get</a><code style='color:#806030; '>(</code>GET<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>digest</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
+<p class="source">
+<code class="sh_comment">/* Get the "digest" key from the query string, if any. */</code>
+<code class="sh_declare">const</code> <code class="sh_declare">char</code><code class="sh_misc"> *</code>digestType <code class="sh_misc">=</code> <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__apr__tables.html#ga4db13e3915c6b9a3142b175d4c15d915">apr_table_get</a><code class="sh_misc">(</code>GET<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">digest</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
 
-<code style='color:#c34e00; '>/* If no key was returned, we will set a default value instead. */</code>
-<code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code><code style='color:#806030; '>!</code>digestType<code style='color:#806030; '>)</code> digestType <code style='color:#806030; '>=</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>sha1</code><code style='color:#800000; '>"</code><code style='color:#806030; '>;</code>
+<code class="sh_comment">/* If no key was returned, we will set a default value instead. */</code>
+<code class="sh_declare">if</code> <code class="sh_misc">(</code><code class="sh_misc">!</code>digestType<code class="sh_misc">)</code> digestType <code class="sh_misc">=</code> <code class="sh_character">"</code><code class="sh_value">sha1</code><code class="sh_character">"</code><code class="sh_misc">;</code>
 
-</pre>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 The structures used for the POST and GET data are not exactly the same, so 
 if we were to fetch a value from POST data instead of the query string, we 
 would have to resort to a few more lines, as outlined in <a href="#get_post"
@@ -562,130 +580,133 @@ would have to resort to a few more lines
 </section>
 
 <section id="advanced_handler"><title>Making an advanced handler</title>
+<p>
 Now that we have learned how to parse form data and manage our resources, 
 we can move on to creating an advanced version of our module, that spits 
-out the MD5 or SHA1 digest of files:<br/>
+out the MD5 or SHA1 digest of files:
+</p>
 
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>static</code> <code style='color:#400000; font-weight:bold; '>int</code> example_handler<code style='color:#806030; '>(</code>request_rec <code style='color:#806030; '>*</code>r<code style='color:#806030; '>)</code>
-<code style='color:#806030; '>{</code>
-    <code style='color:#400000; font-weight:bold; '>int</code> rc<code style='color:#806030; '>,</code> exists<code style='color:#806030; '>;</code>
-    apr_finfo_t finfo<code style='color:#806030; '>;</code>
-    apr_file_t<code style='color:#806030; '> *</code>file<code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>char</code> <code style='color:#806030; '>*</code>filename<code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>char</code> buffer<code style='color:#806030; '>[</code><code style='color:#c00000; '>256</code><code style='color:#806030; '>]</code><code style='color:#806030; '>;</code>
-    apr_size_t readBytes<code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>int</code> n<code style='color:#806030; '>;</code>
-    apr_table_t<code style='color:#806030; '> *</code>GET<code style='color:#806030; '>;</code>
-    apr_array_header_t<code style='color:#806030; '> *</code>POST<code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>const</code> <code style='color:#400000; font-weight:bold; '>char</code><code style='color:#806030; '> *</code>digestType<code style='color:#806030; '>;</code>
-    
-    
-    <code style='color:#c34e00; '>/* Check that the "example-handler" handler is being called. */</code>
-    <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code><code style='color:#806030; '>!</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>handler</code> <code style='color:#806030; '>|</code><code style='color:#806030; '>|</code> <code style='color:#800040; '>strcmp</code><code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>handler</code><code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>example-handler</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>)</code> <code style='color:#400000; font-weight:bold; '>return</code> <code style='color:#806030; '>(</code>DECLINED<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* Figure out which file is being requested by removing the .sum from it */</code>
-    filename <code style='color:#806030; '>=</code> apr_pstrdup<code style='color:#806030; '>(</code>r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>pool</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>filename</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    filename<code style='color:#806030; '>[</code><code style='color:#800040; '>strlen</code><code style='color:#806030; '>(</code>filename<code style='color:#806030; '>)</code><code style='color:#806030; '>-</code><code style='color:#c00000; '>4</code><code style='color:#806030; '>]</code> <code style='color:#806030; '>=</code> <code style='color:#c00000; '>0</code><code style='color:#806030; '>;</code> <code style='color:#c34e00; '>/* Cut off the last 4 characters. */</code>
-    
-    <code style='color:#c34e00; '>/* Figure out if the file we request a sum on exists and isn't a directory */</code>
-    rc <code style='color:#806030; '>=</code> apr_stat<code style='color:#806030; '>(</code><code style='color:#806030; '>&amp;</code>finfo<code style='color:#806030; '>,</code> filename<code style='color:#806030; '>,</code> APR_FINFO_MIN<code style='color:#806030; '>,</code> r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>pool</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code>rc <code style='color:#806030; '>=</code><code style='color:#806030; '>=</code> APR_SUCCESS<code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-        exists <code style='color:#806030; '>=</code>
-        <code style='color:#806030; '>(</code>
-            <code style='color:#806030; '>(</code>finfo<code style='color:#806030; '>.</code>filetype <code style='color:#806030; '>!</code><code style='color:#806030; '>=</code> APR_NOFILE<code style='color:#806030; '>)</code>
-        <code style='color:#806030; '>&amp;</code><code style='color:#806030; '>&amp;</code>  <code style='color:#806030; '>!</code><code style='color:#806030; '>(</code>finfo<code style='color:#806030; '>.</code>filetype <code style='color:#806030; '>&amp;</code> APR_DIR<code style='color:#806030; '>)</code>
-        <code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-        <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code><code style='color:#806030; '>!</code>exists<code style='color:#806030; '>)</code> <code style='color:#400000; font-weight:bold; '>return</code> HTTP_NOT_FOUND<code style='color:#806030; '>;</code> <code style='color:#c34e00; '>/* Return a 404 if not found. */</code>
-    <code style='color:#806030; '>}</code>
-    <code style='color:#c34e00; '>/* If apr_stat failed, we're probably not allowed to check this file. */</code>
-    <code style='color:#400000; font-weight:bold; '>else</code> <code style='color:#400000; font-weight:bold; '>return</code> HTTP_FORBIDDEN<code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* Parse the GET and, optionally, the POST data sent to us */</code>
-    
-    ap_args_to_table<code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#806030; '>&amp;</code>GET<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    ap_parse_form_data<code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#007d45; '>NULL</code><code style='color:#806030; '>,</code> <code style='color:#806030; '>&amp;</code>POST<code style='color:#806030; '>,</code> <code style='color:#806030; '>-</code><code style='color:#c00000; '>1</code><code style='color:#806030; '>,</code> <code style='color:#c00000; '>8192</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* Set the appropriate content type */</code>
-    ap_set_content_type<code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>text/html</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* Print a title and some general information */</code>
-    ap_rprintf<code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;h2>Information on </code><code style='color:#0f6900; '>%s</code><code style='color:#e60000; '>:&lt;/h2></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> filename<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    ap_rprintf<code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;b>Size:&lt;/b> </code><code style='color:#0f6900; '>%u</code><code style='color:#e60000; '> bytes&lt;br/></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> finfo<code style='color:#806030; '>.</code>size<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    
-    <code style='color:#c34e00; '>/* Get the digest type the client wants to see */</code>
-    digestType <code style='color:#806030; '>=</code> apr_table_get<code style='color:#806030; '>(</code>GET<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>digest</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code><code style='color:#806030; '>!</code>digestType<code style='color:#806030; '>)</code> digestType <code style='color:#806030; '>=</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>MD5</code><code style='color:#800000; '>"</code><code style='color:#806030; '>;</code>
+<p class="source">
+<code class="sh_declare">static</code> <code class="sh_declare">int</code> example_handler<code class="sh_misc">(</code>request_rec <code class="sh_misc">*</code>r<code class="sh_misc">)</code>
+<code class="sh_misc">{</code>
+    <code class="sh_declare">int</code> rc<code class="sh_misc">,</code> exists<code class="sh_misc">;</code>
+    apr_finfo_t finfo<code class="sh_misc">;</code>
+    apr_file_t<code class="sh_misc"> *</code>file<code class="sh_misc">;</code>
+    <code class="sh_declare">char</code> <code class="sh_misc">*</code>filename<code class="sh_misc">;</code>
+    <code class="sh_declare">char</code> buffer<code class="sh_misc">[</code><code class="sh_reference">256</code><code class="sh_misc">]</code><code class="sh_misc">;</code>
+    apr_size_t readBytes<code class="sh_misc">;</code>
+    <code class="sh_declare">int</code> n<code class="sh_misc">;</code>
+    apr_table_t<code class="sh_misc"> *</code>GET<code class="sh_misc">;</code>
+    apr_array_header_t<code class="sh_misc"> *</code>POST<code class="sh_misc">;</code>
+    <code class="sh_declare">const</code> <code class="sh_declare">char</code><code class="sh_misc"> *</code>digestType<code class="sh_misc">;</code>
+    
+    
+    <code class="sh_comment">/* Check that the "example-handler" handler is being called. */</code>
+    <code class="sh_declare">if</code> <code class="sh_misc">(</code><code class="sh_misc">!</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">handler</code> <code class="sh_misc">|</code><code class="sh_misc">|</code> <code class="sh_function">strcmp</code><code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">handler</code><code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">example-handler</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">)</code> <code class="sh_declare">return</code> <code class="sh_misc">(</code>DECLINED<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    
+    <code class="sh_comment">/* Figure out which file is being requested by removing the .sum from it */</code>
+    filename <code class="sh_misc">=</code> apr_pstrdup<code class="sh_misc">(</code>r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">pool</code><code class="sh_misc">,</code> r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">filename</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    filename<code class="sh_misc">[</code><code class="sh_function">strlen</code><code class="sh_misc">(</code>filename<code class="sh_misc">)</code><code class="sh_misc">-</code><code class="sh_reference">4</code><code class="sh_misc">]</code> <code class="sh_misc">=</code> <code class="sh_reference">0</code><code class="sh_misc">;</code> <code class="sh_comment">/* Cut off the last 4 characters. */</code>
+    
+    <code class="sh_comment">/* Figure out if the file we request a sum on exists and isn't a directory */</code>
+    rc <code class="sh_misc">=</code> apr_stat<code class="sh_misc">(</code><code class="sh_misc">&amp;</code>finfo<code class="sh_misc">,</code> filename<code class="sh_misc">,</code> APR_FINFO_MIN<code class="sh_misc">,</code> r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">pool</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_declare">if</code> <code class="sh_misc">(</code>rc <code class="sh_misc">=</code><code class="sh_misc">=</code> APR_SUCCESS<code class="sh_misc">)</code> <code class="sh_misc">{</code>
+        exists <code class="sh_misc">=</code>
+        <code class="sh_misc">(</code>
+            <code class="sh_misc">(</code>finfo<code class="sh_misc">.</code>filetype <code class="sh_misc">!</code><code class="sh_misc">=</code> APR_NOFILE<code class="sh_misc">)</code>
+        <code class="sh_misc">&amp;</code><code class="sh_misc">&amp;</code>  <code class="sh_misc">!</code><code class="sh_misc">(</code>finfo<code class="sh_misc">.</code>filetype <code class="sh_misc">&amp;</code> APR_DIR<code class="sh_misc">)</code>
+        <code class="sh_misc">)</code><code class="sh_misc">;</code>
+        <code class="sh_declare">if</code> <code class="sh_misc">(</code><code class="sh_misc">!</code>exists<code class="sh_misc">)</code> <code class="sh_declare">return</code> HTTP_NOT_FOUND<code class="sh_misc">;</code> <code class="sh_comment">/* Return a 404 if not found. */</code>
+    <code class="sh_misc">}</code>
+    <code class="sh_comment">/* If apr_stat failed, we're probably not allowed to check this file. */</code>
+    <code class="sh_declare">else</code> <code class="sh_declare">return</code> HTTP_FORBIDDEN<code class="sh_misc">;</code>
+    
+    <code class="sh_comment">/* Parse the GET and, optionally, the POST data sent to us */</code>
+    
+    ap_args_to_table<code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_misc">&amp;</code>GET<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    ap_parse_form_data<code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_constant">NULL</code><code class="sh_misc">,</code> <code class="sh_misc">&amp;</code>POST<code class="sh_misc">,</code> <code class="sh_misc">-</code><code class="sh_reference">1</code><code class="sh_misc">,</code> <code class="sh_reference">8192</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    
+    <code class="sh_comment">/* Set the appropriate content type */</code>
+    ap_set_content_type<code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">text/html</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    
+    <code class="sh_comment">/* Print a title and some general information */</code>
+    ap_rprintf<code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">&lt;h2>Information on </code><code class="sh_reference">%s</code><code class="sh_value">:&lt;/h2></code><code class="sh_character">"</code><code class="sh_misc">,</code> filename<code class="sh_misc">)</code><code class="sh_misc">;</code>
+    ap_rprintf<code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">&lt;b>Size:&lt;/b> </code><code class="sh_reference">%u</code><code class="sh_value"> bytes&lt;br/></code><code class="sh_character">"</code><code class="sh_misc">,</code> finfo<code class="sh_misc">.</code>size<code class="sh_misc">)</code><code class="sh_misc">;</code>
     
+    <code class="sh_comment">/* Get the digest type the client wants to see */</code>
+    digestType <code class="sh_misc">=</code> apr_table_get<code class="sh_misc">(</code>GET<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">digest</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_declare">if</code> <code class="sh_misc">(</code><code class="sh_misc">!</code>digestType<code class="sh_misc">)</code> digestType <code class="sh_misc">=</code> <code class="sh_character">"</code><code class="sh_value">MD5</code><code class="sh_character">"</code><code class="sh_misc">;</code>
     
-    rc <code style='color:#806030; '>=</code> apr_file_open<code style='color:#806030; '>(</code><code style='color:#806030; '>&amp;</code>file<code style='color:#806030; '>,</code> filename<code style='color:#806030; '>,</code> APR_READ<code style='color:#806030; '>,</code> APR_OS_DEFAULT<code style='color:#806030; '>,</code> r<code style='color:#806030; '>-</code><code style='color:#806030; '>></code><code style='color:#008833'>pool</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-    <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code>rc <code style='color:#806030; '>=</code><code style='color:#806030; '>=</code> APR_SUCCESS<code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
+    
+    rc <code class="sh_misc">=</code> apr_file_open<code class="sh_misc">(</code><code class="sh_misc">&amp;</code>file<code class="sh_misc">,</code> filename<code class="sh_misc">,</code> APR_READ<code class="sh_misc">,</code> APR_OS_DEFAULT<code class="sh_misc">,</code> r<code class="sh_misc">-</code><code class="sh_misc">></code><code class="sh_subobject">pool</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+    <code class="sh_declare">if</code> <code class="sh_misc">(</code>rc <code class="sh_misc">=</code><code class="sh_misc">=</code> APR_SUCCESS<code class="sh_misc">)</code> <code class="sh_misc">{</code>
         
-        <code style='color:#c34e00; '>/* Are we trying to calculate the MD5 or the SHA1 digest? */</code>
-        <code style='color:#400000; font-weight:bold; '>if</code> <code style='color:#806030; '>(</code><code style='color:#806030; '>!</code>strcasecmp<code style='color:#806030; '>(</code>digestType<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#e60000; '>md5</code><code style='color:#800000; '>"</code><code style='color:#806030; '>)</code><code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-            <code style='color:#c34e00; '>/* Calculate the MD5 sum of the file */</code>
-            <code style='color:#400000; font-weight:bold; '>union</code> <code style='color:#806030; '>{</code>
-                <code style='color:#400000; font-weight:bold; '>char</code>      chr<code style='color:#806030; '>[</code><code style='color:#c00000; '>16</code><code style='color:#806030; '>]</code><code style='color:#806030; '>;</code>
-                uint32_t  num<code style='color:#806030; '>[</code><code style='color:#c00000; '>4</code><code style='color:#806030; '>]</code><code style='color:#806030; '>;</code>
-            <code style='color:#806030; '>}</code> digest<code style='color:#806030; '>;</code>
-            apr_md5_ctx_t md5<code style='color:#806030; '>;</code>
-            apr_md5_init<code style='color:#806030; '>(</code><code style='color:#806030; '>&amp;</code>md5<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            readBytes <code style='color:#806030; '>=</code> <code style='color:#c00000; '>256</code><code style='color:#806030; '>;</code>
-            <code style='color:#400000; font-weight:bold; '>while</code> <code style='color:#806030; '>(</code> apr_file_read<code style='color:#806030; '>(</code>file<code style='color:#806030; '>,</code> buffer<code style='color:#806030; '>,</code> <code style='color:#806030; '>&amp;</code>readBytes<code style='color:#806030; '>)</code> <code style='color:#806030; '>=</code><code style='color:#806030; '>=</code> APR_SUCCESS <code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-                apr_md5_update<code style='color:#806030; '>(</code><code style='color:#806030; '>&amp;</code>md5<code style='color:#806030; '>,</code> buffer<code style='color:#806030; '>,</code> readBytes<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            <code style='color:#806030; '>}</code>
-            apr_md5_final<code style='color:#806030; '>(</code>digest<code style='color:#806030; '>.</code>chr<code style='color:#806030; '>,</code> <code style='color:#806030; '>&amp;</code>md5<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
+        <code class="sh_comment">/* Are we trying to calculate the MD5 or the SHA1 digest? */</code>
+        <code class="sh_declare">if</code> <code class="sh_misc">(</code><code class="sh_misc">!</code>strcasecmp<code class="sh_misc">(</code>digestType<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_value">md5</code><code class="sh_character">"</code><code class="sh_misc">)</code><code class="sh_misc">)</code> <code class="sh_misc">{</code>
+            <code class="sh_comment">/* Calculate the MD5 sum of the file */</code>
+            <code class="sh_declare">union</code> <code class="sh_misc">{</code>
+                <code class="sh_declare">char</code>      chr<code class="sh_misc">[</code><code class="sh_reference">16</code><code class="sh_misc">]</code><code class="sh_misc">;</code>
+                uint32_t  num<code class="sh_misc">[</code><code class="sh_reference">4</code><code class="sh_misc">]</code><code class="sh_misc">;</code>
+            <code class="sh_misc">}</code> digest<code class="sh_misc">;</code>
+            apr_md5_ctx_t md5<code class="sh_misc">;</code>
+            apr_md5_init<code class="sh_misc">(</code><code class="sh_misc">&amp;</code>md5<code class="sh_misc">)</code><code class="sh_misc">;</code>
+            readBytes <code class="sh_misc">=</code> <code class="sh_reference">256</code><code class="sh_misc">;</code>
+            <code class="sh_declare">while</code> <code class="sh_misc">(</code> apr_file_read<code class="sh_misc">(</code>file<code class="sh_misc">,</code> buffer<code class="sh_misc">,</code> <code class="sh_misc">&amp;</code>readBytes<code class="sh_misc">)</code> <code class="sh_misc">=</code><code class="sh_misc">=</code> APR_SUCCESS <code class="sh_misc">)</code> <code class="sh_misc">{</code>
+                apr_md5_update<code class="sh_misc">(</code><code class="sh_misc">&amp;</code>md5<code class="sh_misc">,</code> buffer<code class="sh_misc">,</code> readBytes<code class="sh_misc">)</code><code class="sh_misc">;</code>
+            <code class="sh_misc">}</code>
+            apr_md5_final<code class="sh_misc">(</code>digest<code class="sh_misc">.</code>chr<code class="sh_misc">,</code> <code class="sh_misc">&amp;</code>md5<code class="sh_misc">)</code><code class="sh_misc">;</code>
             
-            <code style='color:#c34e00; '>/* Print out the MD5 digest */</code>
-            ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;b>MD5: &lt;/b>&lt;code></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            <code style='color:#400000; font-weight:bold; '>for</code> <code style='color:#806030; '>(</code>n <code style='color:#806030; '>=</code> <code style='color:#c00000; '>0</code><code style='color:#806030; '>;</code> n <code style='color:#806030; '>&lt;</code> APR_MD5_DIGESTSIZE<code style='color:#806030; '>/</code><code style='color:#c00000; '>4</code><code style='color:#806030; '>;</code> n<code style='color:#806030; '>+</code><code style='color:#806030; '>+</code><code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-                ap_rprintf<code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#0f6900; '>%08x</code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> digest<code style='color:#806030; '>.</code>num<code style='color:#806030; '>[</code>n<code style='color:#806030; '>]</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            <code style='color:#806030; '>}</code>
-            ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;/code></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            <code style='color:#c34e00; '>/* Print a link to the SHA1 version */</code>
-            ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;br/>&lt;a href='?digest=sha1'>View the SHA1 hash instead&lt;/a></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-        <code style='color:#806030; '>}</code>
-        <code style='color:#400000; font-weight:bold; '>else</code> <code style='color:#806030; '>{</code>
-            <code style='color:#c34e00; '>/* Calculate the SHA1 sum of the file */</code>
-            <code style='color:#400000; font-weight:bold; '>union</code> <code style='color:#806030; '>{</code>
-                <code style='color:#400000; font-weight:bold; '>char</code>      chr<code style='color:#806030; '>[</code><code style='color:#c00000; '>20</code><code style='color:#806030; '>]</code><code style='color:#806030; '>;</code>
-                uint32_t  num<code style='color:#806030; '>[</code><code style='color:#c00000; '>5</code><code style='color:#806030; '>]</code><code style='color:#806030; '>;</code>
-            <code style='color:#806030; '>}</code> digest<code style='color:#806030; '>;</code>
-            apr_sha1_ctx_t sha1<code style='color:#806030; '>;</code>
-            apr_sha1_init<code style='color:#806030; '>(</code><code style='color:#806030; '>&amp;</code>sha1<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            readBytes <code style='color:#806030; '>=</code> <code style='color:#c00000; '>256</code><code style='color:#806030; '>;</code>
-            <code style='color:#400000; font-weight:bold; '>while</code> <code style='color:#806030; '>(</code> apr_file_read<code style='color:#806030; '>(</code>file<code style='color:#806030; '>,</code> buffer<code style='color:#806030; '>,</code> <code style='color:#806030; '>&amp;</code>readBytes<code style='color:#806030; '>)</code> <code style='color:#806030; '>=</code><code style='color:#806030; '>=</code> APR_SUCCESS <code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-                apr_sha1_update<code style='color:#806030; '>(</code><code style='color:#806030; '>&amp;</code>sha1<code style='color:#806030; '>,</code> buffer<code style='color:#806030; '>,</code> readBytes<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            <code style='color:#806030; '>}</code>
-            apr_sha1_final<code style='color:#806030; '>(</code>digest<code style='color:#806030; '>.</code>chr<code style='color:#806030; '>,</code> <code style='color:#806030; '>&amp;</code>sha1<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
+            <code class="sh_comment">/* Print out the MD5 digest */</code>
+            ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">&lt;b>MD5: &lt;/b>&lt;code></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
+            <code class="sh_declare">for</code> <code class="sh_misc">(</code>n <code class="sh_misc">=</code> <code class="sh_reference">0</code><code class="sh_misc">;</code> n <code class="sh_misc">&lt;</code> APR_MD5_DIGESTSIZE<code class="sh_misc">/</code><code class="sh_reference">4</code><code class="sh_misc">;</code> n<code class="sh_misc">+</code><code class="sh_misc">+</code><code class="sh_misc">)</code> <code class="sh_misc">{</code>
+                ap_rprintf<code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_reference">%08x</code><code class="sh_character">"</code><code class="sh_misc">,</code> digest<code class="sh_misc">.</code>num<code class="sh_misc">[</code>n<code class="sh_misc">]</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+            <code class="sh_misc">}</code>
+            ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">&lt;/code></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
+            <code class="sh_comment">/* Print a link to the SHA1 version */</code>
+            ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">&lt;br/>&lt;a href='?digest=sha1'>View the SHA1 hash instead&lt;/a></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
+        <code class="sh_misc">}</code>
+        <code class="sh_declare">else</code> <code class="sh_misc">{</code>
+            <code class="sh_comment">/* Calculate the SHA1 sum of the file */</code>
+            <code class="sh_declare">union</code> <code class="sh_misc">{</code>
+                <code class="sh_declare">char</code>      chr<code class="sh_misc">[</code><code class="sh_reference">20</code><code class="sh_misc">]</code><code class="sh_misc">;</code>
+                uint32_t  num<code class="sh_misc">[</code><code class="sh_reference">5</code><code class="sh_misc">]</code><code class="sh_misc">;</code>
+            <code class="sh_misc">}</code> digest<code class="sh_misc">;</code>
+            apr_sha1_ctx_t sha1<code class="sh_misc">;</code>
+            apr_sha1_init<code class="sh_misc">(</code><code class="sh_misc">&amp;</code>sha1<code class="sh_misc">)</code><code class="sh_misc">;</code>
+            readBytes <code class="sh_misc">=</code> <code class="sh_reference">256</code><code class="sh_misc">;</code>
+            <code class="sh_declare">while</code> <code class="sh_misc">(</code> apr_file_read<code class="sh_misc">(</code>file<code class="sh_misc">,</code> buffer<code class="sh_misc">,</code> <code class="sh_misc">&amp;</code>readBytes<code class="sh_misc">)</code> <code class="sh_misc">=</code><code class="sh_misc">=</code> APR_SUCCESS <code class="sh_misc">)</code> <code class="sh_misc">{</code>
+                apr_sha1_update<code class="sh_misc">(</code><code class="sh_misc">&amp;</code>sha1<code class="sh_misc">,</code> buffer<code class="sh_misc">,</code> readBytes<code class="sh_misc">)</code><code class="sh_misc">;</code>
+            <code class="sh_misc">}</code>
+            apr_sha1_final<code class="sh_misc">(</code>digest<code class="sh_misc">.</code>chr<code class="sh_misc">,</code> <code class="sh_misc">&amp;</code>sha1<code class="sh_misc">)</code><code class="sh_misc">;</code>
             
-            <code style='color:#c34e00; '>/* Print out the SHA1 digest */</code>
-            ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;b>SHA1: &lt;/b>&lt;code></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            <code style='color:#400000; font-weight:bold; '>for</code> <code style='color:#806030; '>(</code>n <code style='color:#806030; '>=</code> <code style='color:#c00000; '>0</code><code style='color:#806030; '>;</code> n <code style='color:#806030; '>&lt;</code> APR_SHA1_DIGESTSIZE<code style='color:#806030; '>/</code><code style='color:#c00000; '>4</code><code style='color:#806030; '>;</code> n<code style='color:#806030; '>+</code><code style='color:#806030; '>+</code><code style='color:#806030; '>)</code> <code style='color:#806030; '>{</code>
-                ap_rprintf<code style='color:#806030; '>(</code>r<code style='color:#806030; '>,</code> <code style='color:#800000; '>"</code><code style='color:#0f6900; '>%08x</code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> digest<code style='color:#806030; '>.</code>num<code style='color:#806030; '>[</code>n<code style='color:#806030; '>]</code><code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-            <code style='color:#806030; '>}</code>
-            ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;/code></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
+            <code class="sh_comment">/* Print out the SHA1 digest */</code>
+            ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">&lt;b>SHA1: &lt;/b>&lt;code></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
+            <code class="sh_declare">for</code> <code class="sh_misc">(</code>n <code class="sh_misc">=</code> <code class="sh_reference">0</code><code class="sh_misc">;</code> n <code class="sh_misc">&lt;</code> APR_SHA1_DIGESTSIZE<code class="sh_misc">/</code><code class="sh_reference">4</code><code class="sh_misc">;</code> n<code class="sh_misc">+</code><code class="sh_misc">+</code><code class="sh_misc">)</code> <code class="sh_misc">{</code>
+                ap_rprintf<code class="sh_misc">(</code>r<code class="sh_misc">,</code> <code class="sh_character">"</code><code class="sh_reference">%08x</code><code class="sh_character">"</code><code class="sh_misc">,</code> digest<code class="sh_misc">.</code>num<code class="sh_misc">[</code>n<code class="sh_misc">]</code><code class="sh_misc">)</code><code class="sh_misc">;</code>
+            <code class="sh_misc">}</code>
+            ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">&lt;/code></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
             
-            <code style='color:#c34e00; '>/* Print a link to the MD5 version */</code>
-            ap_rputs<code style='color:#806030; '>(</code><code style='color:#800000; '>"</code><code style='color:#e60000; '>&lt;br/>&lt;a href='?digest=md5'>View the MD5 hash instead&lt;/a></code><code style='color:#800000; '>"</code><code style='color:#806030; '>,</code> r<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
-        <code style='color:#806030; '>}</code>
-        apr_file_close<code style='color:#806030; '>(</code>file<code style='color:#806030; '>)</code><code style='color:#806030; '>;</code>
+            <code class="sh_comment">/* Print a link to the MD5 version */</code>
+            ap_rputs<code class="sh_misc">(</code><code class="sh_character">"</code><code class="sh_value">&lt;br/>&lt;a href='?digest=md5'>View the MD5 hash instead&lt;/a></code><code class="sh_character">"</code><code class="sh_misc">,</code> r<code class="sh_misc">)</code><code class="sh_misc">;</code>
+        <code class="sh_misc">}</code>
+        apr_file_close<code class="sh_misc">(</code>file<code class="sh_misc">)</code><code class="sh_misc">;</code>
         
-    <code style='color:#806030; '>}</code>
+    <code class="sh_misc">}</code>
     
     
     
-    <code style='color:#c34e00; '>/* Let the server know that we responded to this request. */</code>
-    <code style='color:#400000; font-weight:bold; '>return</code> OK<code style='color:#806030; '>;</code>
-<code style='color:#806030; '>}</code>
-</pre>
+    <code class="sh_comment">/* Let the server know that we responded to this request. */</code>
+    <code class="sh_declare">return</code> OK<code class="sh_misc">;</code>
+<code class="sh_misc">}</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 This version in its entirity can be found here: 
 <a href="http://people.apache.org/~humbedooh/mods/examples/mod_example_2.c">mod_example_2.c</a>.
+</p>
 </section>
 
 </section>
@@ -718,128 +739,132 @@ that parses the parameters given and set
 </p>
 </section>
 <section id="config_simple"><title>Making an example configuration</title>
-To begin with, we'll create a basic configuration in C-space:
+<p>To begin with, we'll create a basic configuration in C-space:</p>
 
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>typedef</code> <code style='color:#400000; font-weight:bold; '>struct</code> <code style='color:#806030; '>{</code>
-    <code style='color:#400000; font-weight:bold; '>int</code>         enabled<code style='color:#806030; '>;</code>      <code style='color:#c34e00; '>/* Enable or disable our module */</code>
-    <code style='color:#400000; font-weight:bold; '>const</code> <code style='color:#400000; font-weight:bold; '>char</code> <code style='color:#806030; '>*</code>path<code style='color:#806030; '>;</code>         <code style='color:#c34e00; '>/* Some path to...something */</code>
-    <code style='color:#400000; font-weight:bold; '>int</code>         typeOfAction<code style='color:#806030; '>;</code> <code style='color:#c34e00; '>/* 1 means action A, 2 means action B and so on */</code>
-<code style='color:#806030; '>}</code> example_config<code style='color:#806030; '>;</code>
-</pre>
+<p class="source">
+<code class="sh_declare">typedef</code> <code class="sh_declare">struct</code> <code class="sh_misc">{</code>
+    <code class="sh_declare">int</code>         enabled<code class="sh_misc">;</code>      <code class="sh_comment">/* Enable or disable our module */</code>
+    <code class="sh_declare">const</code> <code class="sh_declare">char</code> <code class="sh_misc">*</code>path<code class="sh_misc">;</code>         <code class="sh_comment">/* Some path to...something */</code>
+    <code class="sh_declare">int</code>         typeOfAction<code class="sh_misc">;</code> <code class="sh_comment">/* 1 means action A, 2 means action B and so on */</code>
+<code class="sh_misc">}</code> example_config<code class="sh_misc">;</code>
+</p>
 <!-- END EXAMPLE CODE -->
 
-
+<p>
 Now, let's put this into perspective by creating a very small module that 
 just prints out a hard-coded configuration. You'll notice that we use the 
 <code>register_hooks</code> function for initializing the configuration 
 values to their defaults:
-
+</p>
 
 <!-- BEGIN EXAMPLE CODE -->
-<pre style='color:#000000;background:#ffffef;border: 1px dashed #333; padding: 0.5em; margin: 1em 2em 1em 1em;'>
-<code style='color:#400000; font-weight:bold; '>typedef</code> <code style='color:#400000; font-weight:bold; '>struct</code> <code style='color:#806030; '>{</code>
-    <code style='color:#400000; font-weight:bold; '>int</code>         enabled<code style='color:#806030; '>;</code>      <code style='color:#c34e00; '>/* Enable or disable our module */</code>
-    <code style='color:#400000; font-weight:bold; '>const</code> <code style='color:#400000; font-weight:bold; '>char</code> <code style='color:#806030; '>*</code>path<code style='color:#806030; '>;</code>         <code style='color:#c34e00; '>/* Some path to...something */</code>

[... 1410 lines stripped ...]


Mime
View raw message