diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:19 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:45 +0100 |
commit | 2a463b3cd73c32ee9dcd508248d0194923f435f4 (patch) | |
tree | 2ff478255a77a55031056790918b6f983bb7b20a /docs/manual/developer | |
parent | 86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45 (diff) | |
download | apache2-upstream/2.4.9.tar.gz |
Imported Upstream version 2.4.9upstream/2.4.9
Diffstat (limited to 'docs/manual/developer')
-rw-r--r-- | docs/manual/developer/API.html.en | 9 | ||||
-rw-r--r-- | docs/manual/developer/debugging.html.en | 4 | ||||
-rw-r--r-- | docs/manual/developer/documenting.html | 2 | ||||
-rw-r--r-- | docs/manual/developer/documenting.html.en | 4 | ||||
-rw-r--r-- | docs/manual/developer/documenting.html.zh-cn.utf8 (renamed from docs/manual/developer/documenting.html.zh-cn) | 4 | ||||
-rw-r--r-- | docs/manual/developer/filters.html.en | 14 | ||||
-rw-r--r-- | docs/manual/developer/hooks.html.en | 56 | ||||
-rw-r--r-- | docs/manual/developer/index.html | 2 | ||||
-rw-r--r-- | docs/manual/developer/index.html.en | 4 | ||||
-rw-r--r-- | docs/manual/developer/index.html.zh-cn.utf8 (renamed from docs/manual/developer/index.html.zh-cn) | 4 | ||||
-rw-r--r-- | docs/manual/developer/modguide.html.en | 213 | ||||
-rw-r--r-- | docs/manual/developer/modules.html.en | 13 | ||||
-rw-r--r-- | docs/manual/developer/modules.html.ja.utf8 | 13 | ||||
-rw-r--r-- | docs/manual/developer/new_api_2_4.html.en | 4 | ||||
-rw-r--r-- | docs/manual/developer/output-filters.html.en | 34 | ||||
-rw-r--r-- | docs/manual/developer/request.html.en | 10 | ||||
-rw-r--r-- | docs/manual/developer/thread_safety.html.en | 4 |
17 files changed, 138 insertions, 256 deletions
diff --git a/docs/manual/developer/API.html.en b/docs/manual/developer/API.html.en index d2c7eb8f..e7055b68 100644 --- a/docs/manual/developer/API.html.en +++ b/docs/manual/developer/API.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -358,9 +358,7 @@ struct stat finfo; /* Set by server core; </code></p><pre>int header_only; /* HEAD request, as opposed to GET */ char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ char *method; /* GET, HEAD, POST, <em>etc.</em> */ -int method_number; /* M_GET, M_POST, <em>etc.</em> */ - -</pre><p><code> +int method_number; /* M_GET, M_POST, <em>etc.</em> */</pre><p><code> /* Info for logging */<br /> <br /> char *the_request;<br /> @@ -382,7 +380,6 @@ int method_number; /* M_GET, M_POST, <em>etc.</em> */ <br /> </code></p><pre>void *per_dir_config; /* Options set in config files, <em>etc.</em> */ void *request_config; /* Notes on *this* request */</pre><p><code> - <br /> }; </code></p></div> @@ -1237,7 +1234,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/API.html'; } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/debugging.html.en b/docs/manual/developer/debugging.html.en index f5d69788..0ea2a58f 100644 --- a/docs/manual/developer/debugging.html.en +++ b/docs/manual/developer/debugging.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -49,7 +49,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/debugging. } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/documenting.html b/docs/manual/developer/documenting.html index 499eee1c..d001174c 100644 --- a/docs/manual/developer/documenting.html +++ b/docs/manual/developer/documenting.html @@ -4,6 +4,6 @@ URI: documenting.html.en Content-Language: en Content-type: text/html; charset=ISO-8859-1 -URI: documenting.html.zh-cn +URI: documenting.html.zh-cn.utf8 Content-Language: zh-cn Content-type: text/html; charset=UTF-8 diff --git a/docs/manual/developer/documenting.html.en b/docs/manual/developer/documenting.html.en index 5e441801..82f35355 100644 --- a/docs/manual/developer/documenting.html.en +++ b/docs/manual/developer/documenting.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -101,7 +101,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/documentin } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/documenting.html.zh-cn b/docs/manual/developer/documenting.html.zh-cn.utf8 index b6be8f73..37dc8240 100644 --- a/docs/manual/developer/documenting.html.zh-cn +++ b/docs/manual/developer/documenting.html.zh-cn.utf8 @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -98,7 +98,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/documentin } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />基于 <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> 许可证.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />基于 <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> 许可证.</p> <p class="menu"><a href="../mod/">模块</a> | <a href="../mod/directives.html">指令</a> | <a href="http://wiki.apache.org/httpd/FAQ">常见问题</a> | <a href="../glossary.html">术语</a> | <a href="../sitemap.html">网站导航</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/filters.html.en b/docs/manual/developer/filters.html.en index aa9e1434..a90b3abe 100644 --- a/docs/manual/developer/filters.html.en +++ b/docs/manual/developer/filters.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -133,19 +133,15 @@ same set of filters as the main request. A graphical representation might help:</p> -<div class="example"><pre> -Default_handler --> includes_filter --> byterange --> ... -</pre></div> +<div class="example"><pre>Default_handler --> includes_filter --> byterange --> ...</pre></div> <p>If the includes filter creates a sub request, then we don't want the data from that sub-request to go through the includes filter, because it might not be SSI data. So, the subrequest adds the following:</p> -<div class="example"><pre> -Default_handler --> includes_filter -/-> byterange --> ... +<div class="example"><pre>Default_handler --> includes_filter -/-> byterange --> ... / -Default_handler --> sub_request_core -</pre></div> +Default_handler --> sub_request_core</pre></div> <p>What happens if the subrequest is SSI data? Well, that's easy, the <code>includes_filter</code> is a resource filter, so it will be added to @@ -225,7 +221,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/filters.ht } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/hooks.html.en b/docs/manual/developer/hooks.html.en index 43cf1cca..f6482901 100644 --- a/docs/manual/developer/hooks.html.en +++ b/docs/manual/developer/hooks.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -49,9 +49,7 @@ arguments. For example, if the hook returns an <code>int</code> and takes a <code>request_rec *</code> and an <code>int</code> and is called <code>do_something</code>, then declare it like this:</p> - <pre class="prettyprint lang-c"> - AP_DECLARE_HOOK(int, do_something, (request_rec *r, int n)) - </pre> + <pre class="prettyprint lang-c">AP_DECLARE_HOOK(int, do_something, (request_rec *r, int n))</pre> <p>This should go in a header which modules will include if @@ -63,12 +61,10 @@ which is used to record the module functions that use the hook. This is declared as follows:</p> - <pre class="prettyprint lang-c"> -APR_HOOK_STRUCT( + <pre class="prettyprint lang-c">APR_HOOK_STRUCT( APR_HOOK_LINK(do_something) ... -) - </pre> +)</pre> @@ -82,9 +78,7 @@ APR_HOOK_STRUCT( <p>If the return value of a hook is <code>void</code>, then all the hooks are called, and the caller is implemented like this:</p> - <pre class="prettyprint lang-c"> - AP_IMPLEMENT_HOOK_VOID(do_something, (request_rec *r, int n), (r, n)) - </pre> + <pre class="prettyprint lang-c">AP_IMPLEMENT_HOOK_VOID(do_something, (request_rec *r, int n), (r, n))</pre> <p>The second and third arguments are the dummy argument @@ -92,13 +86,11 @@ APR_HOOK_STRUCT( calling the hook. In other words, this macro expands to something like this:</p> - <pre class="prettyprint lang-c"> -void ap_run_do_something(request_rec *r, int n) + <pre class="prettyprint lang-c">void ap_run_do_something(request_rec *r, int n) { ... do_something(r, n); -} - </pre> +}</pre> @@ -106,9 +98,7 @@ void ap_run_do_something(request_rec *r, int n) <p>If the hook returns a value, then it can either be run until the first hook that does something interesting, like so:</p> - <pre class="prettyprint lang-c"> - AP_IMPLEMENT_HOOK_RUN_FIRST(int, do_something, (request_rec *r, int n), (r, n), DECLINED) - </pre> + <pre class="prettyprint lang-c">AP_IMPLEMENT_HOOK_RUN_FIRST(int, do_something, (request_rec *r, int n), (r, n), DECLINED)</pre> <p>The first hook that does <em>not</em> return <code>DECLINED</code> @@ -124,9 +114,7 @@ void ap_run_do_something(request_rec *r, int n) value other than one of those two stops the loop, and its return is the return value. Declare these like so:</p> - <pre class="prettyprint lang-c"> - AP_IMPLEMENT_HOOK_RUN_ALL(int, do_something, (request_rec *r, int n), (r, n), OK, DECLINED) - </pre> + <pre class="prettyprint lang-c">AP_IMPLEMENT_HOOK_RUN_ALL(int, do_something, (request_rec *r, int n), (r, n), OK, DECLINED)</pre> <p>Again, <code>OK</code> and <code>DECLINED</code> are the traditional @@ -138,12 +126,10 @@ void ap_run_do_something(request_rec *r, int n) <p>At appropriate moments in the code, call the hook caller, like so:</p> - <pre class="prettyprint lang-c"> -int n, ret; + <pre class="prettyprint lang-c">int n, ret; request_rec *r; -ret=ap_run_do_something(r, n); - </pre> +ret=ap_run_do_something(r, n);</pre> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> @@ -156,13 +142,11 @@ ret=ap_run_do_something(r, n); <p>Include the appropriate header, and define a static function of the correct type:</p> - <pre class="prettyprint lang-c"> -static int my_something_doer(request_rec *r, int n)<br /> + <pre class="prettyprint lang-c">static int my_something_doer(request_rec *r, int n)<br /> { ... return OK; -} - </pre> +}</pre> @@ -171,8 +155,7 @@ static int my_something_doer(request_rec *r, int n)<br /> registering function, which is included in the module structure:</p> - <pre class="prettyprint lang-c"> -static void my_register_hooks() + <pre class="prettyprint lang-c">static void my_register_hooks() { ap_hook_do_something(my_something_doer, NULL, NULL, APR_HOOK_MIDDLE); } @@ -181,8 +164,7 @@ mode MODULE_VAR_EXPORT my_module = { ... my_register_hooks /* register hooks */ -}; - </pre> +};</pre> @@ -215,14 +197,12 @@ mode MODULE_VAR_EXPORT my_module = example, suppose we want "mod_xyz.c" and "mod_abc.c" to run before we do, then we'd hook as follows:</p> - <pre class="prettyprint lang-c"> -static void register_hooks() + <pre class="prettyprint lang-c">static void register_hooks() { static const char * const aszPre[] = { "mod_xyz.c", "mod_abc.c", NULL }; ap_hook_do_something(my_something_doer, aszPre, NULL, APR_HOOK_MIDDLE); -} - </pre> +}</pre> <p>Note that the sort used to achieve this is stable, so @@ -251,7 +231,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/hooks.html } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/index.html b/docs/manual/developer/index.html index c260e8bc..aaa13b29 100644 --- a/docs/manual/developer/index.html +++ b/docs/manual/developer/index.html @@ -4,6 +4,6 @@ URI: index.html.en Content-Language: en Content-type: text/html; charset=ISO-8859-1 -URI: index.html.zh-cn +URI: index.html.zh-cn.utf8 Content-Language: zh-cn Content-type: text/html; charset=UTF-8 diff --git a/docs/manual/developer/index.html.en b/docs/manual/developer/index.html.en index 141f157b..b6baf97d 100644 --- a/docs/manual/developer/index.html.en +++ b/docs/manual/developer/index.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -76,7 +76,7 @@ <p><span>Available Languages: </span><a href="../en/developer/" title="English"> en </a> | <a href="../zh-cn/developer/" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p> </div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/index.html.zh-cn b/docs/manual/developer/index.html.zh-cn.utf8 index 7518fab2..e5160f53 100644 --- a/docs/manual/developer/index.html.zh-cn +++ b/docs/manual/developer/index.html.zh-cn.utf8 @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -77,7 +77,7 @@ <p><span>可用语言: </span><a href="../en/developer/" hreflang="en" rel="alternate" title="English"> en </a> | <a href="../zh-cn/developer/" title="Simplified Chinese"> zh-cn </a></p> </div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />基于 <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> 许可证.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />基于 <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> 许可证.</p> <p class="menu"><a href="../mod/">模块</a> | <a href="../mod/directives.html">指令</a> | <a href="http://wiki.apache.org/httpd/FAQ">常见问题</a> | <a href="../glossary.html">术语</a> | <a href="../sitemap.html">网站导航</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/modguide.html.en b/docs/manual/developer/modguide.html.en index b4faa66f..e7713d07 100644 --- a/docs/manual/developer/modguide.html.en +++ b/docs/manual/developer/modguide.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -82,9 +82,7 @@ using <a href="../programs/apxs.html">APXS</a>. Assuming your source file is called mod_example.c, compiling, installing and activating the module is as simple as: </p> -<div class="example"><pre> -apxs -i -a -c mod_example.c -</pre></div> +<div class="example"><pre>apxs -i -a -c mod_example.c</pre></div> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> @@ -97,8 +95,7 @@ that defines a module as <em>a separate entity within Apache</em>:</p> -<pre class="prettyprint lang-c"> -module AP_MODULE_DECLARE_DATA example_module = +<pre class="prettyprint lang-c">module AP_MODULE_DECLARE_DATA example_module = { STANDARD20_MODULE_STUFF, create_dir_conf, /* Per-directory configuration handler */ @@ -107,8 +104,7 @@ module AP_MODULE_DECLARE_DATA example_module = merge_svr_conf, /* Merge handler for per-server configurations */ directives, /* Any directives we may have for httpd */ register_hooks /* Our hook registering function */ -}; -</pre> +};</pre> @@ -125,9 +121,7 @@ of the module is used primarily for two things:<br /> For now, we're only concerned with the first purpose of the module name, which comes into play when we need to load the module: </p> -<pre class="prettyprint lang-config"> -LoadModule example_module modules/mod_example.so -</pre> +<pre class="prettyprint lang-config">LoadModule example_module modules/mod_example.so</pre> <p> In essence, this tells the server to open up <code>mod_example.so</code> and look for a module @@ -171,9 +165,7 @@ our example case, we want every request ending with .sum to be served by <code>mod_example</code>, so we'll add a configuration directive that tells the server to do just that: </p> -<pre class="prettyprint lang-config"> -AddHandler example-handler .sum -</pre> +<pre class="prettyprint lang-config">AddHandler example-handler .sum</pre> <p> What this tells the server is the following: <em>Whenever we receive a request @@ -195,8 +187,7 @@ definition will look like this:</p> -<pre class="prettyprint lang-c"> -module AP_MODULE_DECLARE_DATA example_module = +<pre class="prettyprint lang-c">module AP_MODULE_DECLARE_DATA example_module = { STANDARD20_MODULE_STUFF, NULL, @@ -205,8 +196,7 @@ module AP_MODULE_DECLARE_DATA example_module = NULL, NULL, register_hooks /* Our hook registering function */ -}; -</pre> +};</pre> @@ -223,13 +213,11 @@ to hook into its process as one of the last modules: </p> -<pre class="prettyprint lang-c"> -static void register_hooks(apr_pool_t *pool) +<pre class="prettyprint lang-c">static void register_hooks(apr_pool_t *pool) { /* Create a hook in the request handler, so we get called when a request arrives */ ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_LAST); -} -</pre> +}</pre> @@ -279,8 +267,7 @@ In C code, our example handler will now look like this: </p> -<pre class="prettyprint lang-c"> -static int example_handler(request_rec *r) +<pre class="prettyprint lang-c">static int example_handler(request_rec *r) { /* First off, we need to check if this is a call for the "example-handler" handler. * If it is, we accept it and do our things, if not, we simply return DECLINED, @@ -298,8 +285,7 @@ static int example_handler(request_rec *r) * We do so by simply returning the value OK to the server. */ return OK; -} -</pre> +}</pre> @@ -344,8 +330,7 @@ Let's try out some of these variables in another example handler:<br /> </p> -<pre class="prettyprint lang-c"> -static int example_handler(request_rec *r) +<pre class="prettyprint lang-c">static int example_handler(request_rec *r) { /* Set the appropriate content type */ ap_set_content_type(r, "text/html"); @@ -366,8 +351,7 @@ static int example_handler(request_rec *r) ap_rprintf(r, "Your query string was: %s", r->args); } return OK; -} -</pre> +}</pre> @@ -384,13 +368,11 @@ status code, for example: </p> -<pre class="prettyprint lang-c"> -static int example_handler(request_rec *r) +<pre class="prettyprint lang-c">static int example_handler(request_rec *r) { /* Return 404: Not found */ return HTTP_NOT_FOUND; -} -</pre> +}</pre> @@ -500,8 +482,7 @@ apr_pool_t *p, const char *fmt, ...)</code>: Similar to <code>sprintf</code>, ex -<pre class="prettyprint lang-c"> -static int example_handler(request_rec *r) +<pre class="prettyprint lang-c">static int example_handler(request_rec *r) { const char* original = "You can't edit this!"; char* copy; @@ -513,8 +494,7 @@ static int example_handler(request_rec *r) /* Create a copy of the 'original' variable that we can edit. */ copy = apr_pstrdup(r->pool, original); return OK; -} -</pre> +}</pre> @@ -527,15 +507,13 @@ function to sort it out: </p> -<pre class="prettyprint lang-c"> -static void register_hooks(apr_pool_t *pool) +<pre class="prettyprint lang-c">static void register_hooks(apr_pool_t *pool) { /* Call a function that initializes some stuff */ example_init_function(pool); /* Create a hook in the request handler, so we get called when a request arrives */ ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_LAST); -} -</pre> +}</pre> @@ -575,8 +553,7 @@ POST data is four simple lines: <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#gaed25877b529623a4d8f99f819ba1b7bd"> ap_args_to_table</a>(r, &GET); <em> </em><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__DAEMON.html#ga9d426b6382b49754d4f87c55f65af202"> -ap_parse_form_data</a>(r, NULL, &POST, -1, 8192); -</pre> +ap_parse_form_data</a>(r, NULL, &POST, -1, 8192);</pre> @@ -588,13 +565,11 @@ GET</code>. To extract this value, we need only perform a simple operation: -<pre class="prettyprint lang-c"> -/* Get the "digest" key from the query string, if any. */ +<pre class="prettyprint lang-c">/* Get the "digest" key from the query string, if any. */ const char *digestType = apr_table_get(GET, "digest"); /* If no key was returned, we will set a default value instead. */ -if (!digestType) digestType = "sha1"; -</pre> +if (!digestType) digestType = "sha1";</pre> @@ -614,8 +589,7 @@ out the MD5 or SHA1 digest of files: -<pre class="prettyprint lang-c"> -static int example_handler(request_rec *r) +<pre class="prettyprint lang-c">static int example_handler(request_rec *r) { int rc, exists; apr_finfo_t finfo; @@ -722,8 +696,7 @@ static int example_handler(request_rec *r) } /* Let the server know that we responded to this request. */ return OK; -} -</pre> +}</pre> @@ -752,11 +725,9 @@ what a configuration directive is. Simply put, a directive is a way of telling an individual module (or a set of modules) how to behave, such as these directives control how <code>mod_rewrite</code> works: </p> -<pre class="prettyprint lang-config"> -RewriteEngine On +<pre class="prettyprint lang-config">RewriteEngine On RewriteCond %{REQUEST_URI} ^/foo/bar -RewriteRule ^/foo/bar/(.*)$ /foobar?page=$1 -</pre> +RewriteRule ^/foo/bar/(.*)$ /foobar?page=$1</pre> <p> Each of these configuration directives are handled by a separate function, @@ -768,13 +739,11 @@ that parses the parameters given and sets up a configuration accordingly. -<pre class="prettyprint lang-c"> -typedef struct { +<pre class="prettyprint lang-c">typedef struct { int enabled; /* Enable or disable our module */ const char *path; /* Some path to...something */ int typeOfAction; /* 1 means action A, 2 means action B and so on */ -} example_config; -</pre> +} example_config;</pre> @@ -786,8 +755,7 @@ values to their defaults: </p> -<pre class="prettyprint lang-c"> -typedef struct { +<pre class="prettyprint lang-c">typedef struct { int enabled; /* Enable or disable our module */ const char *path; /* Some path to...something */ int typeOfAction; /* 1 means action A, 2 means action B and so on */ @@ -824,8 +792,7 @@ module AP_MODULE_DECLARE_DATA example_module = NULL, /* Merge handler for per-server configurations */ NULL, /* Any directives we may have for httpd */ register_hooks /* Our hook registering function */ -}; -</pre> +};</pre> @@ -833,11 +800,9 @@ module AP_MODULE_DECLARE_DATA example_module = So far so good. To access our new handler, we could add the following to our configuration: </p> -<pre class="prettyprint lang-config"> -<Location /example> +<pre class="prettyprint lang-config"><Location /example> SetHandler example-handler -</Location> -</pre> +</Location></pre> <p> When we visit, we'll see our current configuration being spit out by our @@ -855,8 +820,7 @@ reference to the configuration directives we want to register with the server: </p> -<pre class="prettyprint lang-c"> -module AP_MODULE_DECLARE_DATA example_module = +<pre class="prettyprint lang-c">module AP_MODULE_DECLARE_DATA example_module = { STANDARD20_MODULE_STUFF, NULL, /* Per-directory configuration handler */ @@ -865,8 +829,7 @@ module AP_MODULE_DECLARE_DATA example_module = NULL, /* Merge handler for per-server configurations */ example_directives, /* Any directives we may have for httpd */ register_hooks /* Our hook registering function */ -}; -</pre> +};</pre> @@ -879,15 +842,13 @@ will add a structure with three directives and a NULL at the end: </p> -<pre class="prettyprint lang-c"> -static const command_rec example_directives[] = +<pre class="prettyprint lang-c">static const command_rec example_directives[] = { AP_INIT_TAKE1("exampleEnabled", example_set_enabled, NULL, RSRC_CONF, "Enable or disable mod_example"), AP_INIT_TAKE1("examplePath", example_set_path, NULL, RSRC_CONF, "The path to whatever"), AP_INIT_TAKE2("exampleAction", example_set_action, NULL, RSRC_CONF, "Special action value!"), { NULL } -}; -</pre> +};</pre> @@ -926,8 +887,7 @@ exampleAction</code> directive to accept two arguments, its C function also has an additional parameter defined:</p> -<pre class="prettyprint lang-c"> -/* Handler for the "exampleEnabled" directive */ +<pre class="prettyprint lang-c">/* Handler for the "exampleEnabled" directive */ const char *example_set_enabled(cmd_parms *cmd, void *cfg, const char *arg) { if(!strcasecmp(arg, "on")) config.enabled = 1; @@ -953,8 +913,7 @@ const char *example_set_action(cmd_parms *cmd, void *cfg, const char *arg1, cons if(!strcasecmp(arg2, "deny")) config.typeOfAction += 0x10; else config.typeOfAction += 0x20; return NULL; -} -</pre> +}</pre> @@ -967,8 +926,7 @@ we can assemble our module into one big file: </p> -<pre class="prettyprint lang-c"> -/* mod_example_config_simple.c: */ +<pre class="prettyprint lang-c">/* mod_example_config_simple.c: */ #include <stdio.h> #include "apr_hash.h" #include "ap_config.h" @@ -1079,8 +1037,7 @@ module AP_MODULE_DECLARE_DATA example_module = NULL, /* Merge handler for per-server configurations */ example_directives, /* Any directives we may have for httpd */ register_hooks /* Our hook registering function */ -}; -</pre> +};</pre> @@ -1089,11 +1046,9 @@ module AP_MODULE_DECLARE_DATA example_module = In our httpd.conf file, we can now change the hard-coded configuration by adding a few lines: </p> -<pre class="prettyprint lang-config"> -ExampleEnabled On +<pre class="prettyprint lang-config">ExampleEnabled On ExamplePath "/usr/bin/foo" -ExampleAction file allow -</pre> +ExampleAction file allow</pre> <p> And thus we apply the configuration, visit <code>/example</code> on our @@ -1113,15 +1068,13 @@ different meanings to the user of the server, and thus different contexts within which modules must operate. For example, let's assume you have this configuration set up for mod_rewrite: </p> -<pre class="prettyprint lang-config"> -<Directory "/var/www"> +<pre class="prettyprint lang-config"><Directory "/var/www"> RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule (.*) http://www.example.com/$1 </Directory> <Directory "/var/www/sub"> RewriteRule ^foobar$ index.php?foobar=true -</Directory> -</pre> +</Directory></pre> <p> In this example, you will have set up two different contexts for @@ -1144,9 +1097,7 @@ directory or location in question? It does so by making one simple call: </p> -<pre class="prettyprint lang-c"> -example_config *config = (example_config*) <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__CONFIG.html#ga1093a5908a384eacc929b028c79f2a02">ap_get_module_config</a>(r->per_dir_config, &example_module); -</pre> +<pre class="prettyprint lang-c">example_config *config = (example_config*) <a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__CONFIG.html#ga1093a5908a384eacc929b028c79f2a02">ap_get_module_config</a>(r->per_dir_config, &example_module);</pre> @@ -1165,14 +1116,12 @@ variable that we can use to track which context configuration is being used by the server in various places: </p> -<pre class="prettyprint lang-c"> -typedef struct { +<pre class="prettyprint lang-c">typedef struct { char context[256]; char path[256]; int typeOfAction; int enabled; -} example_config; -</pre> +} example_config;</pre> @@ -1180,8 +1129,7 @@ typedef struct { -<pre class="prettyprint lang-c"> -static int example_handler(request_rec *r) +<pre class="prettyprint lang-c">static int example_handler(request_rec *r) { if(!r->handler || strcmp(r->handler, "example-handler")) return(DECLINED); example_config *config = (example_config*) ap_get_module_config(r->per_dir_config, &example_module); @@ -1191,8 +1139,7 @@ static int example_handler(request_rec *r) ap_rprintf("TypeOfAction: %x\n", config->typeOfAction); ap_rprintf("Context: %s\n", config->context); return OK; -} -</pre> +}</pre> @@ -1206,9 +1153,7 @@ a directive required five elements be set:</p> -<pre class="prettyprint lang-c"> -AP_INIT_TAKE1("exampleEnabled", example_set_enabled, NULL, RSRC_CONF, "Enable or disable mod_example"), -</pre> +<pre class="prettyprint lang-c">AP_INIT_TAKE1("exampleEnabled", example_set_enabled, NULL, RSRC_CONF, "Enable or disable mod_example"),</pre> @@ -1241,8 +1186,7 @@ and managing our configurations. Since we have chosen the per-directory per-directory creator and merger function reference in our tag:</p> -<pre class="prettyprint lang-c"> -module AP_MODULE_DECLARE_DATA example_module = +<pre class="prettyprint lang-c">module AP_MODULE_DECLARE_DATA example_module = { STANDARD20_MODULE_STUFF, create_dir_conf, /* Per-directory configuration handler */ @@ -1251,8 +1195,7 @@ module AP_MODULE_DECLARE_DATA example_module = NULL, /* Merge handler for per-server configurations */ directives, /* Any directives we may have for httpd */ register_hooks /* Our hook registering function */ -}; -</pre> +};</pre> @@ -1267,8 +1210,7 @@ our first step is to make a function for creating new, blank configurations. We do so by creating the function we just referenced in our name tag as the Per-directory configuration handler:</p> -<pre class="prettyprint lang-c"> -void* example_create_dir_conf(apr_pool_t* pool, char* context) { +<pre class="prettyprint lang-c">void* example_create_dir_conf(apr_pool_t* pool, char* context) { context = context ? context : "(undefined context)"; example_config *cfg = apr_pcalloc(pool, sizeof(example_config)); if(cfg) { @@ -1279,8 +1221,7 @@ void* example_create_dir_conf(apr_pool_t* pool, char* context) { cfg->typeOfAction = 0x11; } return cfg; -} -</pre> +}</pre> @@ -1293,16 +1234,14 @@ Our next step in creating a context aware configuration is merging configurations. This part of the process particularly applies to scenarios where you have a parent configuration and a child, such as the following: </p> -<pre class="prettyprint lang-config"> -<Directory "/var/www"> +<pre class="prettyprint lang-config"><Directory "/var/www"> ExampleEnabled On ExamplePath /foo/bar ExampleAction file allow </Directory> <Directory "/var/www/subdir"> ExampleAction file deny -</Directory> -</pre> +</Directory></pre> <p> In this example, it is natural to assume that the directory <code> @@ -1325,8 +1264,7 @@ two configurations and decide how they are to be merged:</p> -<pre class="prettyprint lang-c"> -void* merge_dir_conf(apr_pool_t* pool, void* BASE, void* ADD) { +<pre class="prettyprint lang-c">void* merge_dir_conf(apr_pool_t* pool, void* BASE, void* ADD) { example_config* base = (example_config *) BASE ; /* This is what was set in the parent context */ example_config* add = (example_config *) ADD ; /* This is what is set in the new context */ example_config* conf = (example_config *) create_dir_conf(pool, "Merged configuration"); /* This will be the merged configuration */ @@ -1337,8 +1275,7 @@ void* merge_dir_conf(apr_pool_t* pool, void* BASE, void* ADD) { strcpy(conf->path, strlen(add->path) ? add->path : base->path); return conf ; -} -</pre> +}</pre> @@ -1351,8 +1288,7 @@ Now, let's try putting it all together to create a new module that is context aware. First off, we'll create a configuration that lets us test how the module works: </p> -<pre class="prettyprint lang-config"> -<Location "/a"> +<pre class="prettyprint lang-config"><Location "/a"> SetHandler example-handler ExampleEnabled on ExamplePath "/foo/bar" @@ -1368,8 +1304,7 @@ how the module works: ExampleAction db deny ExamplePath "/foo/bar/baz" ExampleEnabled on -</Location> -</pre> +</Location></pre> <p> Then we'll assemble our module code. Note, that since we are now using our @@ -1378,8 +1313,7 @@ added some prototypes to keep the compiler happy: </p> -<pre class="prettyprint lang-c"> -/*$6 +<pre class="prettyprint lang-c">/*$6 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * mod_example_config.c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1602,8 +1536,7 @@ void *merge_dir_conf(apr_pool_t *pool, void *BASE, void *ADD) conf->typeOfAction = add->typeOfAction ? add->typeOfAction : base->typeOfAction; strcpy(conf->path, strlen(add->path) ? add->path : base->path); return conf; -} -</pre> +}</pre> @@ -1630,8 +1563,7 @@ or check out the rest of our documentation for further tips. -<pre class="prettyprint lang-c"> -typedef struct { +<pre class="prettyprint lang-c">typedef struct { const char* key; const char* value; } keyValuePair; @@ -1684,8 +1616,7 @@ static int example_handler(request_rec *r) } } return OK; -} -</pre> +}</pre> @@ -1696,8 +1627,7 @@ static int example_handler(request_rec *r) -<pre class="prettyprint lang-c"> -static int example_handler(request_rec *r) +<pre class="prettyprint lang-c">static int example_handler(request_rec *r) { /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ const apr_array_header_t *fields; @@ -1711,8 +1641,7 @@ static int example_handler(request_rec *r) ap_rprintf(r, "%s: %s\n", e[i].key, e[i].val); } return OK; -} -</pre> +}</pre> @@ -1723,8 +1652,7 @@ static int example_handler(request_rec *r) -<pre class="prettyprint lang-c"> -static int util_read(request_rec *r, const char **rbuf, apr_off_t *size) +<pre class="prettyprint lang-c">static int util_read(request_rec *r, const char **rbuf, apr_off_t *size) { /*~~~~~~~~*/ int rc = OK; @@ -1770,8 +1698,7 @@ static int example_handler(request_rec* r) ap_rprintf(r, "We read a request body that was %" APR_OFF_T_FMT " bytes long", size); } return OK; -} - </pre> +}</pre> @@ -1800,7 +1727,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/modguide.h } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/modules.html.en b/docs/manual/developer/modules.html.en index a600d5b6..7c6063e0 100644 --- a/docs/manual/developer/modules.html.en +++ b/docs/manual/developer/modules.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -86,8 +86,7 @@ will be called in.</p> <p>This is the code that was added to <code>mod_mmap_static</code>:</p> - <div class="example"><pre> -static void register_hooks(void) + <div class="example"><pre>static void register_hooks(void) { static const char * const aszPre[]={ "http_core.c",NULL }; ap_hook_post_config(mmap_post_config,NULL,NULL,HOOK_MIDDLE); @@ -131,8 +130,7 @@ static void register_hooks(void) creating your module definition. The old definition looked like</p> - <div class="example"><pre> -module MODULE_VAR_EXPORT <var>module_name</var>_module = + <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module = { STANDARD_MODULE_STUFF, /* initializer */ @@ -156,8 +154,7 @@ module MODULE_VAR_EXPORT <var>module_name</var>_module = };</pre></div> <p>The new structure is a great deal simpler...</p> - <div class="example"><pre> -module MODULE_VAR_EXPORT <var>module_name</var>_module = + <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module = { STANDARD20_MODULE_STUFF, /* create per-directory config structures */ @@ -298,7 +295,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/modules.ht } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/modules.html.ja.utf8 b/docs/manual/developer/modules.html.ja.utf8 index a76b76b9..cbba318b 100644 --- a/docs/manual/developer/modules.html.ja.utf8 +++ b/docs/manual/developer/modules.html.ja.utf8 @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -95,8 +95,7 @@ <p>以下は、<code>mod_mmap_static</code> に追加したコードです:</p> - <div class="example"><pre> -static void register_hooks(void) + <div class="example"><pre>static void register_hooks(void) { static const char * const aszPre[]={ "http_core.c",NULL }; ap_hook_post_config(mmap_post_config,NULL,NULL,HOOK_MIDDLE); @@ -139,8 +138,7 @@ static void register_hooks(void) <p>モジュールの定義を作成する際に注意しなければならない ステージの数は激減しています。古い定義は次のようになっていました。</p> - <div class="example"><pre> -module MODULE_VAR_EXPORT <var>module_name</var>_module = + <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module = { STANDARD_MODULE_STUFF, /* initializer */ @@ -164,8 +162,7 @@ module MODULE_VAR_EXPORT <var>module_name</var>_module = };</pre></div> <p>新しい構造体はとってもシンプルです…</p> - <div class="example"><pre> -module MODULE_VAR_EXPORT <var>module_name</var>_module = + <div class="example"><pre>module MODULE_VAR_EXPORT <var>module_name</var>_module = { STANDARD20_MODULE_STUFF, /* create per-directory config structures */ @@ -293,7 +290,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/modules.ht } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> <p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/new_api_2_4.html.en b/docs/manual/developer/new_api_2_4.html.en index ba10c06e..1303725c 100644 --- a/docs/manual/developer/new_api_2_4.html.en +++ b/docs/manual/developer/new_api_2_4.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -590,7 +590,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/new_api_2_ } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/output-filters.html.en b/docs/manual/developer/output-filters.html.en index 3b71d093..f6d9de68 100644 --- a/docs/manual/developer/output-filters.html.en +++ b/docs/manual/developer/output-filters.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -129,14 +129,12 @@ brigade should have no side effects (such as changing any state private to the filter).</p> - <div class="example"><h3>How to handle an empty brigade</h3><pre class="prettyprint lang-c"> - apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb)<br /> + <div class="example"><h3>How to handle an empty brigade</h3><pre class="prettyprint lang-c"> apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb)<br /> { if (APR_BRIGADE_EMPTY(bb)) { return APR_SUCCESS; } - .... - </pre> + ....</pre> </div> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> @@ -254,8 +252,7 @@ <p>Taking an example which loops through the entire brigade as follows:</p> - <div class="example"><h3>Bad output filter -- do not imitate!</h3><pre class="prettyprint lang-c"> -apr_bucket *e = APR_BRIGADE_FIRST(bb); + <div class="example"><h3>Bad output filter -- do not imitate!</h3><pre class="prettyprint lang-c">apr_bucket *e = APR_BRIGADE_FIRST(bb); const char *data; apr_size_t len; @@ -265,8 +262,7 @@ while (e != APR_BRIGADE_SENTINEL(bb)) { } -return ap_pass_brigade(bb); -</pre> +return ap_pass_brigade(bb);</pre> </div> <p>The above implementation would consume memory proportional to @@ -279,8 +275,7 @@ return ap_pass_brigade(bb); amount of memory to filter any brigade; a temporary brigade is needed and must be allocated only once per response, see the <a href="#state">Maintaining state</a> section.</p> - <div class="example"><h3>Better output filter</h3><pre class="prettyprint lang-c"> -apr_bucket *e; + <div class="example"><h3>Better output filter</h3><pre class="prettyprint lang-c">apr_bucket *e; const char *data; apr_size_t len; @@ -295,8 +290,7 @@ while ((e = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) { rv = ap_pass_brigade(f->next, tmpbb); if (rv) ...; apr_brigade_cleanup(tmpbb); -} -</pre> +}</pre> </div> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> @@ -311,8 +305,7 @@ while ((e = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) { temporary brigade in such a structure, to avoid having to allocate a new brigade per invocation as described in the <a href="#brigade">Brigade structure</a> section.</p> - <div class="example"><h3>Example code to maintain filter state</h3><pre class="prettyprint lang-c"> -struct dummy_state { + <div class="example"><h3>Example code to maintain filter state</h3><pre class="prettyprint lang-c">struct dummy_state { apr_bucket_brigade *tmpbb; int filter_state; .... @@ -334,8 +327,7 @@ apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb) state->filter_state = ...; } - ... -</pre> + ...</pre> </div> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> @@ -410,8 +402,7 @@ apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb) script; reading from such a bucket will block when waiting for the CGI script to produce more output.</p> - <div class="example"><h3>Example code using non-blocking bucket reads</h3><pre class="prettyprint lang-c"> -apr_bucket *e; + <div class="example"><h3>Example code using non-blocking bucket reads</h3><pre class="prettyprint lang-c">apr_bucket *e; apr_read_type_e mode = APR_NONBLOCK_READ; while ((e = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) { @@ -436,8 +427,7 @@ while ((e = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) { /* Next time, try a non-blocking read first. */ mode = APR_NONBLOCK_READ; ... -} -</pre> +}</pre> </div> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> @@ -513,7 +503,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/output-fil } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/request.html.en b/docs/manual/developer/request.html.en index f96f44c1..fc022c23 100644 --- a/docs/manual/developer/request.html.en +++ b/docs/manual/developer/request.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -150,8 +150,7 @@ <h2><a name="security" id="security">The Security Phase</a></h2> <p>Needs Documentation. Code is:</p> - <pre class="prettyprint lang-c"> -if ((access_status = ap_run_access_checker(r)) != 0) { + <pre class="prettyprint lang-c">if ((access_status = ap_run_access_checker(r)) != 0) { return decl_die(access_status, "check access", r); } @@ -161,8 +160,7 @@ if ((access_status = ap_run_check_user_id(r)) != 0) { if ((access_status = ap_run_auth_checker(r)) != 0) { return decl_die(access_status, "check authorization", r); -} - </pre> +}</pre> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> @@ -238,7 +236,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/request.ht } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); diff --git a/docs/manual/developer/thread_safety.html.en b/docs/manual/developer/thread_safety.html.en index 63f35b14..b506c76f 100644 --- a/docs/manual/developer/thread_safety.html.en +++ b/docs/manual/developer/thread_safety.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -296,7 +296,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/developer/thread_saf } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); |