Finally merged the branch 'apache20'(+'apache2') back to the main trunk.
[www.jankratochvil.net.git] / project / captive / doc / CacheManager.pm
similarity index 90%
rename from project/captive/doc/CacheManager.html.pl
rename to project/captive/doc/CacheManager.pm
index ba02996..754961c 100755 (executable)
@@ -1,8 +1,6 @@
-#! /usr/bin/perl
-# 
 # $Id$
 # Captive project doc Cache Manager page Perl template.
-# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,24 +23,23 @@ our $CVS_ID=q$Id$;
 use strict;
 use warnings;
 
-BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
 use My::Web;
-require CGI;
-BEGIN { Wuse 'project::captive::doc::Macros'; }
 
 
+sub handler
+{
+       BEGIN { Wuse 'project::captive::doc::Macros'; }
 project::captive::doc::Macros->init(
-               "__PACKAGE__"=>__PACKAGE__,
                "title"=>'Captive NTFS Developer Documentation: NT Cache Manager',
-               "rel_prev"=>'Reverse.html.pl',
-               "rel_next"=>'Details.html.pl',
+               "rel_prev"=>'Reverse.pm',
+               "rel_next"=>'Details.pm',
                );
 
 
 print <<"HERE";
 
 
-<a name="cache_manager"><h1>NT Cache Manager</h1></a>
+<h1 id="cache_manager">NT Cache Manager</h1>
 
        <p>Although there exist some 3rd party documents about
        <span class="productname">NT Cache Manager</span> W32 subsystem such as
@@ -65,7 +62,7 @@ print <<"HERE";
        (<span class="type">ImageSectionObject</span>), insufficient system
        resources from <span class="productname">NT Memory Manager</span>
        or general effort to perform caching features for system performance.</p>
-       <span class="productname">NT Cache Manager</span> of this project has much
+       <p><span class="productname">NT Cache Manager</span> of this project has much
        simpler goal - it just needs to provide compatible
        <span class="productname">NT Cache Manager</span> functionality while
        the other goals of its W32 counterpart are left to be successfuly handled
@@ -108,7 +105,7 @@ print <<"HERE";
        it is permitted to extend mapped size even in the case of existing
        (and dirty) Map or Pin mappings.</p>
 
-       <p><span class="type">PCACHE_MANAGER_CALLBACKS</type> argument can be
+       <p><span class="type">PCACHE_MANAGER_CALLBACKS</span> argument can be
        safely ignored:</p>
 
        <dl>
@@ -147,8 +144,8 @@ print <<"HERE";
        as it may be locked by existing
        <span class="type">ImageSectionObject</span>
        of some file being executed etc.
-       <a name="sharedcachemap_leak">It is fatal to destroy
-       <span class="type">SharedCacheMap</span></a>
+       <span id="sharedcachemap_leak">It is fatal to destroy
+       <span class="type">SharedCacheMap</span></span>
        in the moment you see no other
        references to it as the driver will access it for some moment
        even after <span class="function">CcUninitializeCacheMap()</span>.
@@ -158,7 +155,7 @@ print <<"HERE";
        Fortunately it is safe to never destroy
        <span class="type">SharedCacheMap</span> and leave it leaked - everything
        gets clean in the
-       @{[ a_href 'Details.html.pl#sandbox','sandboxed environment' ]} soon anyway.</p>
+       @{[ a_href 'Details.pm#sandbox','sandboxed environment' ]} soon anyway.</p>
 
        <p>There exist Map and Pin type objects for each
        <span class="type">SharedCacheMap</span> although they look very similiar.
@@ -190,16 +187,16 @@ print <<"HERE";
                <dt>Pin</dt>
                <dd>
                        <p>Pin mapping always represents just one physical page
-                       (<span class="constant">PAGE_SIZE</span> &nspan; 4096 for i386).
+                       (<span class="constant">PAGE_SIZE</span> &ndash; 4096 for i386).
                        Its base offset/length can be safely extended to be aligned to the
                        requested page.</p>
 
                        <p>Pin can have associated pair of oldest and newest
-                       <span class="type>LSN</span> (Linear Sequence Number). It can be
+                       <span class="type">LSN</span> (Linear Sequence Number). It can be
                        set by <span class="function">CcSetDirtyPinnedData()</span>
                        and Cache Manager always tracks the lowest and highest
-                       reported <span class="type>LSN</span> for each page.
-                       <span class="type>LSN</span> is assumed to be
+                       reported <span class="type">LSN</span> for each page.
+                       <span class="type">LSN</span> is assumed to be
                        <span class="constant">0</span> if not set.</p>
 
                        <p>Any existing Pin mapping will be reused for further mappings
@@ -212,10 +209,10 @@ print <<"HERE";
                        There can exist multiple Pin mappings of the same page (although
                        sharing the same memory space). This detaching must be implemented
                        even in the
-                       @{[ a_href 'Details.html.pl#synchronous','single-threaded' ]} W32 implementation
+                       @{[ a_href 'Details.pm#synchronous','single-threaded' ]} W32 implementation
                        of this project as it is affecting the behaviour of Cache Manager.
                        It was never
-                       @{[ a_href 'CacheManager.html.pl#TraceFS','seen' ]} how to behave if multiple dirty Pin
+                       @{[ a_href 'CacheManager.pm#TraceFS','seen' ]} how to behave if multiple dirty Pin
                        mappings of the same page exist.</p>
                </dd>
        </dl>
@@ -235,14 +232,14 @@ print <<"HERE";
        their last unreferencing (in opposite of
        @{[ a_href '#sharedcachemap_leak','leaked <span class="type">SharedCacheMap</span>' ]}).
        Despite it any dirty pages may still be held as the pages
-       (including their <span class="type>LSN</span>s) are cached associated
+       (including their <span class="type">LSN</span>s) are cached associated
        with <span class="type">SharedCacheMap</span>. It may be also possible
        original <span class="productname">Microsoft Windows</span> 
        <span class="productname">Cache Manager</span>
        postpones Pin mapping destroy to later time but it does not matter.</p>
 
 
-       <a name="TraceFS"><h2>TraceFS NT Cache Manager Tracer</h2></a>
+       <h2 id="TraceFS">TraceFS NT Cache Manager Tracer</h2>
 
                <p>@{[ a_href '#cache_manager','Cache Manager behaviour' ]} would be hard
                to analyze just by @{[ a_href '#reverse','reverse engineering' ]} as it
@@ -275,7 +272,7 @@ print <<"HERE";
 
                <p>You can now pray a bit and snap the resulting Cache Manager tracing
                from <span class="productname">WinDbg</span> by
-               @{[ a_href 'Reverse.html.pl#WinDbg','W32 remote kernel debugging' ]}:</p>
+               @{[ a_href 'Reverse.pm#WinDbg','W32 remote kernel debugging' ]}:</p>
 
                @{[ doc_img 'ntdebug-windbg-boot','Successfuly connected <span class="productname">WinDbg</span>' ]}
 
@@ -297,7 +294,7 @@ print <<"HERE";
                @{[ captive_srcfile './src/TraceFS/checktrace.pl' ]} Perl Cache Manager
                validator.</p>
 
-               <a name="TraceFS_general"><h3>TraceFS for general API tracing</h3></a>
+               <h3 id="TraceFS_general">TraceFS for general API tracing</h3>
 
                        <p>Although TraceFS was up to now used only for tracing of
                        <span class="productname">NT Cache Manager</span> it can be easily
@@ -326,4 +323,6 @@ print <<"HERE";
 HERE
 
 
-project::captive::doc::Macros->footer();
+exit;
+}
+1;