Finally merged the branch 'apache20'(+'apache2') back to the main trunk.
[www.jankratochvil.net.git] / project / captive / doc / CallType.pm
similarity index 86%
rename from project/captive/doc/CallType.html.pl
rename to project/captive/doc/CallType.pm
index d1e3049..ce3b7cc 100755 (executable)
@@ -1,8 +1,6 @@
-#! /usr/bin/perl
-# 
 # $Id$
 # Captive project doc Calling Types 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,27 +23,26 @@ 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: API Calling Conventions',
-               "rel_prev"=>'APITypes.html.pl',
-               "rel_next"=>'TODO.html.pl',
+               "rel_prev"=>'APITypes.pm',
+               "rel_next"=>'TODO.pm',
                );
 
 
 print <<"HERE";
 
 
-<a name="calltype"><h1>API Function Calling Conventions</h1></a>
+<h1 id="calltype">API Function Calling Conventions</h1>
 
        <p>Standard UNIX code compiled by GCC (GNU C&nbsp;Compiler) running on host
-       $gnulinux always uses @{[ a_href 'CallType.html.pl#calltype_cdecl','cdecl' ]} ABI (Application
+       $gnulinux always uses @{[ a_href 'CallType.pm#calltype_cdecl','cdecl' ]} ABI (Application
        Binary Interface) calling convention. This calling convention is also the
        default declaration type of UNIX functions.</p>
 
@@ -75,7 +72,7 @@ print <<"HERE";
        occurs the calling type presented between the caller and callee should be
        checked.</p>
 
-       <a name="calltype_cdecl"><h2>W32 Calling Convention &quot;cdecl&quot;</h2></a>
+       <h2 id="calltype_cdecl">W32 Calling Convention &quot;cdecl&quot;</h2>
 
                <p>The only calling convention in the UNIX world. The default one for all
                the compilers. All the arguments are passed on the stack, no arguments
@@ -86,15 +83,15 @@ print <<"HERE";
                @{[ doc_img 'fig/calltype_cdecl',
                                'W32 Calling Convention <span class="constant">cdecl</span> Scheme' ]}
 
-               <table border="1" align="center">
+               <table border="1" class="margin-center">
+                       <caption>Calling Convention <span class="constant">cdecl</span> Characteristics</caption>
                        <tr><td>Arguments freed by         </td><td>caller</td></tr>
                        <tr><td>Arguments on the stack     </td><td>#0 ... #(n-1)</td></tr>
                        <tr><td>Arguments in the registers </td><td>none</td></tr>
                        <tr><td>GCC attribute              </td><td><span class="command">__attribute__((__cdecl__))</span> (default)</td></tr>
-                       <caption>Calling Convention <span class="constant">cdecl</span> Characteristics</caption>
                </table>
 
-       <a name="calltype_stdcall"><h2>W32 Calling Convention &quot;stdcall&quot;</h2></a>
+       <h2 id="calltype_stdcall">W32 Calling Convention &quot;stdcall&quot;</h2>
 
                @{[ doc_img 'fig/calltype_stdcall',
                                'W32 Calling Convention <span class="constant">stdcall</span> Scheme' ]}
@@ -104,18 +101,18 @@ print <<"HERE";
                arguments are cleaned by the callee. Possible inconsistencies in the
                number of function arguments with the function prototype used by the
                caller will result in fatal crash. Variable arguments lists cannot be
-               passed by this convention &ndash; use @{[ a_href 'CallType.html.pl#calltype_cdecl','cdecl' ]}
+               passed by this convention &ndash; use @{[ a_href 'CallType.pm#calltype_cdecl','cdecl' ]}
                instead.</p>
 
-               <table border="1" align="center">
+               <table border="1" class="margin-center">
+                       <caption>Calling Convention <span class="constant">stdcall</span> Characteristics</caption>
                        <tr><td>Arguments freed by         </td><td>callee</td></tr>
                        <tr><td>Arguments on the stack     </td><td>#0 ... #(n-1)</td></tr>
                        <tr><td>Arguments in the registers </td><td>none</td></tr>
                        <tr><td>GCC attribute              </td><td><span class="command">__attribute__((__stdcall__))</span></td></tr>
-                       <caption>Calling Convention <span class="constant">stdcall</span> Characteristics</caption>
                </table>
 
-       <a name="calltype_fastcall"><h2>W32 Calling Convention &quot;fastcall&quot;</h2></a>
+       <h2 id="calltype_fastcall">W32 Calling Convention &quot;fastcall&quot;</h2>
 
                <p>Convention never used in the UNIX world. It needs to be specified for
                W32 compilers. Convention used in the W32 world for its low calling
@@ -125,7 +122,7 @@ print <<"HERE";
                <span class="constant">EDX</span> respectively. Possible inconsistencies
                in the number of function arguments with the function prototype used by
                the caller will result in fatal crash. Variable arguments lists cannot be
-               passed by this convention &ndash; use @{[ a_href 'CallType.html.pl#calltype_cdecl','cdecl' ]}
+               passed by this convention &ndash; use @{[ a_href 'CallType.pm#calltype_cdecl','cdecl' ]}
                instead.</p>
 
                <p>GCC (GNU C&nbsp;Compiler) native support for this calling convention
@@ -145,7 +142,8 @@ print <<"HERE";
                @{[ doc_img 'fig/calltype_fastcall',
                                'W32 Calling Convention <span class="constant">fastcall</span> Scheme' ]}
 
-               <table border="1" align="center">
+               <table border="1" class="margin-center">
+                       <caption>Calling Convention <span class="constant">fastcall</span> Characteristics</caption>
                        <tr><td>Arguments freed by         </td><td>callee</td></tr>
                        <tr><td>Arguments on the stack     </td><td>#2 ... #(n-1)</td></tr>
                        <tr><td>Arguments in the registers </td><td><span class="constant">ECX</span>=#0,
@@ -153,11 +151,12 @@ print <<"HERE";
                        <tr><td>GCC &ge;3.4 attribute      </td><td><span class="command">__attribute__((__fastcall__))</span></td></tr>
                        <tr><td>GCC &lt;3.4 attr. emulation</td><td><span class="command">__attribute__((__stdcall__))</span></td></tr>
                        <tr><td>                           </td><td><span class="command">__attribute__((__regparm__(3) /* EAX,EDX,ECX */))</span></td></tr>
-                       <caption>Calling Convention <span class="constant">fastcall</span> Characteristics</caption>
                </table>
 
 
 HERE
 
 
-project::captive::doc::Macros->footer();
+exit;
+}
+1;