Commit cdafd355 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Update docs to reflect API changes and typos.
  Harrie Hazewinkel <harrie@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89426 13f79535-47bb-0310-9956-ffa450edef68
parent a8babc45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ the modes available and gives instructions on activating them.</p>

<a name="howto">
<h2>Activating Debugging Options</h2>
<p>The various options for debugging memory are now enabled in the apr_general.h header file in APR.  The various options are enabled by uncommenting the define for the option you wish to use.  The section of the code currently looks like this <em>(contained in src/lib/apr/inclide/apr_general.h)</em></p>
<p>The various options for debugging memory are now enabled in the apr_general.h header file in APR.  The various options are enabled by uncommenting the define for the option you wish to use.  The section of the code currently looks like this <em>(contained in srclib/apr/include/apr_pools.h)</em></p>

<pre>
/*
+8 −8
Original line number Diff line number Diff line
@@ -28,13 +28,13 @@ comparison to other modules.</P>

<H3>Declare the hook function</H3>

<P>Use the DECLARE_HOOK macro, which needs to be given the name of the
hook, the return type of the hook function and the arguments. For
<P>Use the AP_DECLARE_HOOK macro, which needs to be given the return
type of the hook function, the name of the hook, and the arguments. For
example, if the hook returns an <TT>int</TT> and takes a
<TT>request_rec *</TT> and an <TT>int</TT> and is called
"do_something", then declare it like this:</P>

<TT>DECLARE_HOOK(int,do_something,(request_rec *r,int n))</TT>
<TT>AP_DECLARE_HOOK(int,do_something,(request_rec *r,int n))</TT>

<P>This should go in a header which modules will include if they want
to use the hook.</P>
@@ -46,8 +46,8 @@ is used to record the module functions that use the hook. This is
declared as follows:</P>

<PRE>
HOOK_STRUCT(
            HOOK_LINK(do_something)
APR_HOOK_STRUCT(
            APR_HOOK_LINK(do_something)
            ...
           )
</PRE>
@@ -64,7 +64,7 @@ this. In all cases, the calling function is called
<P>If the return value of a hook is <TT>void</TT>, then all the hooks are
called, and the caller is implemented like this:</P>

<TT>IMPLEMENT_HOOK_VOID(do_something,(request_rec *r,int
<TT>AP_IMPLEMENT_HOOK_VOID(do_something,(request_rec *r,int
n),(r,n))</TT>

<P>The second and third arguments are the dummy argument declaration and
@@ -84,7 +84,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>

<TT>IMPLEMENT_HOOK_RUN_FIRST(int,do_something,(request_rec *r,int n),(r,n),DECLINED)</TT>
<TT>AP_IMPLEMENT_HOOK_RUN_FIRST(int,do_something,(request_rec *r,int n),(r,n),DECLINED)</TT>

<P>The first hook that <I>doesn't</I> return <TT>DECLINED</TT> stops
the loop and its return value is returned from the hook caller. Note
@@ -98,7 +98,7 @@ nothing". The first function that returns a value other than one of
those two stops the loop, and its return is the return value. Declare
these like so:</P>

<TT>IMPLEMENT_HOOK_RUN_ALL(int,do_something,(request_rec *r,int
<TT>AP_IMPLEMENT_HOOK_RUN_ALL(int,do_something,(request_rec *r,int
n),(r,n),OK,DECLINED)</TT>

<P>Again, <TT>OK</TT> and <TT>DECLINED</TT> are the traditional
+51 −12
Original line number Diff line number Diff line
@@ -35,20 +35,20 @@ These now need to be of type ap_status_t and return a value of that type. Norma
These should now be renamed to better signify where they sit in the overall process.  So the name gets a small change from mmap_init to mmap_post_config.  The arguments passed have undergone a radical change and now look like
</p>
<ul style="list-style:none">
<li>ap_context_t *p,</li>
<li>ap_context_t *plog,</li>
<li>ap_context_t *ptemp,</li>
<li>apr_pools_t *p,</li>
<li>apr_pools_t *plog,</li>
<li>apr_pools_t *ptemp,</li>
<li>server_rec *s</li>
</ul>
<p>
Throughout Apache the old pools have been replced by the ap_context_t, though their use remains remarkably similar.
Throughout Apache the old pools have been replced by the apr_pools_t, though their use remains remarkably similar.
</p>

<h3>Data Types</h3>
<p>
A lot of the data types have been moved into the APR.  This means that some have had a name change, such as the one shown above.  The following is a brief list of some of the changes that you are likely to have to make.
<ul style="list-style:none">
<li>pool becomes ap_context_t</li>
<li>pool becomes apr_pools_t</li>
<li>table becomes ap_table_t</li>
</ul>
<hr>
@@ -171,26 +171,65 @@ The remainder of the old functions should be registered as hooks. There are the
ap_hook_post_config  <em>(this is where the old _init routines get registered)</em>
</li>
<li>
ap_hook_http_method
ap_hook_http_method  <em>(retrieve the http method from a request.  (legacy))</em>
</li>
<li>
ap_hook_open_logs
ap_hook_open_logs  <em>(open any specified logs)</em>
</li>
<li>
ap_hook_auth_checker
ap_hook_auth_checker  <em>(check if the resource requires authorization)</em>
</li>
<li>
ap_hook_default_port
ap_hook_access_checker  <em>(check for module-specific restrictions)</em>
</li>
<li>
ap_hook_access_checker
ap_hook_check_user_id  <em>(check the user-id and password)</em>
</li>
<li>
ap_hook_process_connection
ap_hook_default_port  <em>(retrieve the default port for the server)</em>
</li>
<li>
ap_hook_child_init_hook
ap_hook_pre_connection  <em>(do any setup required just before processing, but after accepting)</em>
</li>
<li>
ap_hook_process_connection  <em>(run the correct protocol)</em>
</li>
<li>
ap_hook_child_init  <em>(call as soon as the child is started)</em>
</li>
<li>
ap_hook_create_request  <em>(??)</em>
</li>
<li>
ap_hook_fixups  <em>(last chance to modify things before generating content)</em>
</li>
<li>
ap_hook_handler  <em>(generate the content)</em>
</li>
<li>
ap_hook_header_parser  <em>(let's modules look at the headers, not used by most modules, because they use post_read_request for this.)</em>
</li>
<li>
ap_hook_insert_filter  <em>(to insert filters into the filter chain)</em>
</li>
<li>
ap_hook_log_transaction  <em>(log information about the request)</em>
</li>
<li>
ap_hook_optional_fn_retrieve  <em>(retrieve any functions registered as optional)</em>
</li>
<li>
ap_hook_post_read_request  <em>(called after reading the request, before any other phase)</em>
</li>
<li>
ap_hook_quick_handler  <em>(??)</em>
</li>
<li>
ap_hook_translate_name  <em>(translate the URI into a filename)</em>
</li>
<li>
ap_hook_type_checker  <em>(determine and/or set the doc type)</em>


<!--#include virtual="footer.html" -->

+51 −12
Original line number Diff line number Diff line
@@ -35,20 +35,20 @@ These now need to be of type ap_status_t and return a value of that type. Norma
These should now be renamed to better signify where they sit in the overall process.  So the name gets a small change from mmap_init to mmap_post_config.  The arguments passed have undergone a radical change and now look like
</p>
<ul style="list-style:none">
<li>ap_context_t *p,</li>
<li>ap_context_t *plog,</li>
<li>ap_context_t *ptemp,</li>
<li>apr_pools_t *p,</li>
<li>apr_pools_t *plog,</li>
<li>apr_pools_t *ptemp,</li>
<li>server_rec *s</li>
</ul>
<p>
Throughout Apache the old pools have been replced by the ap_context_t, though their use remains remarkably similar.
Throughout Apache the old pools have been replced by the apr_pools_t, though their use remains remarkably similar.
</p>

<h3>Data Types</h3>
<p>
A lot of the data types have been moved into the APR.  This means that some have had a name change, such as the one shown above.  The following is a brief list of some of the changes that you are likely to have to make.
<ul style="list-style:none">
<li>pool becomes ap_context_t</li>
<li>pool becomes apr_pools_t</li>
<li>table becomes ap_table_t</li>
</ul>
<hr>
@@ -171,26 +171,65 @@ The remainder of the old functions should be registered as hooks. There are the
ap_hook_post_config  <em>(this is where the old _init routines get registered)</em>
</li>
<li>
ap_hook_http_method
ap_hook_http_method  <em>(retrieve the http method from a request.  (legacy))</em>
</li>
<li>
ap_hook_open_logs
ap_hook_open_logs  <em>(open any specified logs)</em>
</li>
<li>
ap_hook_auth_checker
ap_hook_auth_checker  <em>(check if the resource requires authorization)</em>
</li>
<li>
ap_hook_default_port
ap_hook_access_checker  <em>(check for module-specific restrictions)</em>
</li>
<li>
ap_hook_access_checker
ap_hook_check_user_id  <em>(check the user-id and password)</em>
</li>
<li>
ap_hook_process_connection
ap_hook_default_port  <em>(retrieve the default port for the server)</em>
</li>
<li>
ap_hook_child_init_hook
ap_hook_pre_connection  <em>(do any setup required just before processing, but after accepting)</em>
</li>
<li>
ap_hook_process_connection  <em>(run the correct protocol)</em>
</li>
<li>
ap_hook_child_init  <em>(call as soon as the child is started)</em>
</li>
<li>
ap_hook_create_request  <em>(??)</em>
</li>
<li>
ap_hook_fixups  <em>(last chance to modify things before generating content)</em>
</li>
<li>
ap_hook_handler  <em>(generate the content)</em>
</li>
<li>
ap_hook_header_parser  <em>(let's modules look at the headers, not used by most modules, because they use post_read_request for this.)</em>
</li>
<li>
ap_hook_insert_filter  <em>(to insert filters into the filter chain)</em>
</li>
<li>
ap_hook_log_transaction  <em>(log information about the request)</em>
</li>
<li>
ap_hook_optional_fn_retrieve  <em>(retrieve any functions registered as optional)</em>
</li>
<li>
ap_hook_post_read_request  <em>(called after reading the request, before any other phase)</em>
</li>
<li>
ap_hook_quick_handler  <em>(??)</em>
</li>
<li>
ap_hook_translate_name  <em>(translate the URI into a filename)</em>
</li>
<li>
ap_hook_type_checker  <em>(determine and/or set the doc type)</em>


<!--#include virtual="footer.html" -->