| 1 | <?php
|
|---|
| 2 | $Naziv="Project Odin Sourcecode Documentation Guidelines";
|
|---|
| 3 |
|
|---|
| 4 | require "stilovi.php3";
|
|---|
| 5 | require "Odin32DBHelpers.php3";
|
|---|
| 6 |
|
|---|
| 7 | /* Profiling */
|
|---|
| 8 | $sPageTimer = Odin32DBTimerStart("page timer");
|
|---|
| 9 | /* Profiling */
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | require "01-PreTitle.php3";
|
|---|
| 13 | echo $Naziv;
|
|---|
| 14 | require "02-PostTitle.php3";
|
|---|
| 15 |
|
|---|
| 16 | require "03-MainTableBeg.php3";
|
|---|
| 17 | require "04-ColumnOne.php3";
|
|---|
| 18 |
|
|---|
| 19 | require "05-ColumnTwoHeader.php3";
|
|---|
| 20 | echo $Naziv;
|
|---|
| 21 | require "06-ColumnTwoHeader2.php3";
|
|---|
| 22 |
|
|---|
| 23 | /* I would like to number the sections and subsections */
|
|---|
| 24 | ODin32DBNumberSections();
|
|---|
| 25 |
|
|---|
| 26 | /*
|
|---|
| 27 | *
|
|---|
| 28 | */
|
|---|
| 29 | TekstBeg();
|
|---|
| 30 | echo "
|
|---|
| 31 | This page describes the sourcecode documentation guildelines
|
|---|
| 32 | used in Project Odin.
|
|---|
| 33 | ";
|
|---|
| 34 | TekstEnd();
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 | /*
|
|---|
| 38 | *
|
|---|
| 39 | */
|
|---|
| 40 | Odin32DBNaslov("Introduction","intro");
|
|---|
| 41 | TekstBeg();
|
|---|
| 42 | echo " The documentation guidelines will keep reminding us that documentation
|
|---|
| 43 | is necessary; and we may benefit from it when monitoring progress.
|
|---|
| 44 | (Odin32 API Database) The status for each API function is essential.
|
|---|
| 45 | <p>
|
|---|
| 46 | The documentation style is based on Javadoc and
|
|---|
| 47 | ";
|
|---|
| 48 | UrlLink("sds.sourceforge.net/", "SDS (Software Development Foundation)");
|
|---|
| 49 | echo " . We have made our own additions in form of new keywords.
|
|---|
| 50 | <p>
|
|---|
| 51 | It is of course recommended that everyone follows all of these
|
|---|
| 52 | guidelines, but to some are more important than others. These
|
|---|
| 53 | are marked <i>(required)</i>.
|
|---|
| 54 | ";
|
|---|
| 55 | TekstEnd();
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | /*
|
|---|
| 59 | *
|
|---|
| 60 | */
|
|---|
| 61 | Odin32DBNaslov("File Header <i>(required)</i>","fileheader");
|
|---|
| 62 | TekstBeg();
|
|---|
| 63 | echo " Each and every source file should start with a header like this:
|
|---|
| 64 | ";
|
|---|
| 65 | TekstEnd();
|
|---|
| 66 | CodeBeg();
|
|---|
| 67 | echo "
|
|---|
| 68 | /* \$Id: Odin32GuidelineDocumentation.phtml,v 1.3 2000-08-02 02:19:10 bird Exp $
|
|---|
| 69 | *
|
|---|
| 70 | * <i><insert file description here></i>
|
|---|
| 71 | *
|
|---|
| 72 | * Copyright (c) <i><YYYY>[-YYYY] <author 1></i>
|
|---|
| 73 | [* Copyright (c) <i><YYYY>[-YYYY] <author 2></i>]
|
|---|
| 74 | *
|
|---|
| 75 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 76 | */";
|
|---|
| 77 | CodeEnd();
|
|---|
| 78 | TekstBeg();
|
|---|
| 79 | echo "
|
|---|
| 80 | The file header starts with CVS keyword, \$Id\$. When commiting
|
|---|
| 81 | the file CVS expandes this keyword. Following is a blank line and
|
|---|
| 82 | a description of the file contents. Then a blank line and
|
|---|
| 83 | copyright info for all authors. As the final statement is the
|
|---|
| 84 | license information.<p>
|
|---|
| 85 |
|
|---|
| 86 | <b>Note:</b> If someone like to include CVS keywords (\$Log\$, \$Header\$, \$...)
|
|---|
| 87 | other that \$Id\$, we will have to discuss this in the WAI and MAD
|
|---|
| 88 | teams. As long as a keyword is not decided used (by the MAD or/and the WAI
|
|---|
| 89 | teams), it should not be used!
|
|---|
| 90 | ";
|
|---|
| 91 | TekstEnd();
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 | /*
|
|---|
| 95 | *
|
|---|
| 96 | */
|
|---|
| 97 | Odin32DBNaslov("Function Header <i>(required)</i>", "functonheader");
|
|---|
| 98 | TekstBeg();
|
|---|
| 99 | echo "
|
|---|
| 100 | A function header is required for all API functions and recommended
|
|---|
| 101 | for all other functions. Using and maintaining the described function
|
|---|
| 102 | header will allow us to monitor the progress of the project and
|
|---|
| 103 | generate documentation.<p>
|
|---|
| 104 |
|
|---|
| 105 | <b>Note:</b> The function header which is described here is not the
|
|---|
| 106 | only one found in the sources. You are discouraged from using other
|
|---|
| 107 | function header(s) than the one described here.
|
|---|
| 108 | ";
|
|---|
| 109 | TekstEnd();
|
|---|
| 110 |
|
|---|
| 111 | /*
|
|---|
| 112 | *
|
|---|
| 113 | */
|
|---|
| 114 | Odin32DBPodNaslov("SDS Function Header", "sdsfunctionheader");
|
|---|
| 115 | TekstBeg();
|
|---|
| 116 | echo "
|
|---|
| 117 | <i>(SDS is a Javadoc styled documentation system for many languages.
|
|---|
| 118 | We will use some of the standard SDS tags, and add three Odin specific
|
|---|
| 119 | ones; <tt>@status</tt>, <tt>@group</tt> and <tt>@author</tt>.)</i><p>
|
|---|
| 120 |
|
|---|
| 121 | First have a look at an example function header:
|
|---|
| 122 | ";
|
|---|
| 123 | TekstEnd();
|
|---|
| 124 | CodeBeg();
|
|---|
| 125 | echo "
|
|---|
| 126 | /**
|
|---|
| 127 | * The OpenFileMappingA function opens a named file-mapping object.
|
|---|
| 128 | * @returns HANDLE to map object.
|
|---|
| 129 | * @param dwDesiredAccess access mode
|
|---|
| 130 | * @param bInheritHandle inherit flag
|
|---|
| 131 | * @param lpName address of name of file-mapping object
|
|---|
| 132 | * @status STUB
|
|---|
| 133 | * @group Filemapping
|
|---|
| 134 | * @author Patrick Haller [Mon, 1998/06/15 08:00]
|
|---|
| 135 | */
|
|---|
| 136 | HANDLE WIN32API OS2OpenFileMappingA(DWORD dwDesiredAccess,";
|
|---|
| 137 | CodeEnd();
|
|---|
| 138 |
|
|---|
| 139 | TekstBeg();
|
|---|
| 140 | echo "
|
|---|
| 141 | As you see, the the different parts of the header is identified by a
|
|---|
| 142 | tag (also called keyword). A tag starts with the <tt>'@'</tt>
|
|---|
| 143 | character. Note that the <tt>@param</tt> tag is kind of special as it
|
|---|
| 144 | has a parameter (parametername) and may occur more than once (with
|
|---|
| 145 | different parameternames).<p>
|
|---|
| 146 |
|
|---|
| 147 | Function headers (methods) have the following tags (keywords):<p>
|
|---|
| 148 |
|
|---|
| 149 | <table border=3>
|
|---|
| 150 | <tr><td><b>Tag</b></td>
|
|---|
| 151 | <td><b>Description</b></td>
|
|---|
| 152 | </tr>
|
|---|
| 153 | <tr><td><tt>@desc</tt></font></td>
|
|---|
| 154 | <td><font size=-1>General description. (default)</td>
|
|---|
| 155 | </tr>
|
|---|
| 156 | <tr><td><tt>@return</tt></td>
|
|---|
| 157 | <td><font size=-1>What the function returns (Alias: @returns)</font></td>
|
|---|
| 158 | </tr>
|
|---|
| 159 | <tr><td><tt>@param <paramname></tt></td>
|
|---|
| 160 | <td><font size=-1>Parameters to the function.</font></td>
|
|---|
| 161 | </tr>
|
|---|
| 162 | <tr><td><tt>@status</tt></td>
|
|---|
| 163 | <td><font size=-1>
|
|---|
| 164 | Function status. See ";
|
|---|
| 165 | AnchNaslov("Function State.", "functionstate", "");
|
|---|
| 166 | echo "
|
|---|
| 167 | </font></td>
|
|---|
| 168 | </tr>
|
|---|
| 169 | <tr><td><tt>@group</tt></td>
|
|---|
| 170 | <td><font size=-1>
|
|---|
| 171 | Name of the API Group the function belongs into.
|
|---|
| 172 | This have to be a valid API Group name.<br>
|
|---|
| 173 | See ";
|
|---|
| 174 | LocLink("Odin32DB.phtml?apigroups=1", "here");
|
|---|
| 175 | echo " for current API groups.
|
|---|
| 176 | </font></td>
|
|---|
| 177 | </tr>
|
|---|
| 178 | <tr><td><tt>@time</tt></td>
|
|---|
| 179 | <td><font size=-1>Time complexity or estimated time use.</font></td>
|
|---|
| 180 | </tr>
|
|---|
| 181 | <tr><td><tt>@sketch</tt></td>
|
|---|
| 182 | <td><font size=-1>A sketch of the method, usually for design.</font></td>
|
|---|
| 183 | </tr>
|
|---|
| 184 | <tr><td><tt>@author</tt></td>
|
|---|
| 185 | <td><font size=-1>
|
|---|
| 186 | This is a list of authors. Authors are separated by ',' or
|
|---|
| 187 | by new-line. Make sure to use exactly the same name/signature
|
|---|
| 188 | each time.
|
|---|
| 189 | </font></td>
|
|---|
| 190 | </tr>
|
|---|
| 191 | <tr><td><tt>@remark</tt></td>
|
|---|
| 192 | <td><font size=-1>Any remarks.</font></td>
|
|---|
| 193 | </tr>
|
|---|
| 194 | </table>
|
|---|
| 195 | <p>";
|
|---|
| 196 |
|
|---|
| 197 | TekstBeg();
|
|---|
| 198 | echo "Since <tt>@desc</tt> is default, this form:";
|
|---|
| 199 | TekstEnd();
|
|---|
| 200 |
|
|---|
| 201 | CodeBeg();
|
|---|
| 202 | echo "
|
|---|
| 203 | /** this is a method-description */
|
|---|
| 204 | int foo();";
|
|---|
| 205 | CodeEnd();
|
|---|
| 206 |
|
|---|
| 207 | TekstBeg();
|
|---|
| 208 | echo "is equivalent with:";
|
|---|
| 209 | TekstEnd();
|
|---|
| 210 |
|
|---|
| 211 | CodeBeg();
|
|---|
| 212 | echo "
|
|---|
| 213 | /** @desc this is a method-description */
|
|---|
| 214 | int foo();";
|
|---|
| 215 | CodeEnd();
|
|---|
| 216 |
|
|---|
| 217 | TekstBeg();
|
|---|
| 218 | echo "
|
|---|
| 219 | <b>Note:</b> that you should only include those tags that you use or
|
|---|
| 220 | intend to use. If you don't use the <tt>@time</tt> tag don't waste a
|
|---|
| 221 | line on it.
|
|---|
| 222 | ";
|
|---|
| 223 | TekstEnd();
|
|---|
| 224 |
|
|---|
| 225 | /*
|
|---|
| 226 | * Function State
|
|---|
| 227 | */
|
|---|
| 228 | Odin32DBPodNaslov("Function State","functionstate");
|
|---|
| 229 | TekstBeg();
|
|---|
| 230 | echo "
|
|---|
| 231 | For API functions we will try monitor the implementation progress. To
|
|---|
| 232 | aid us we will assign a state to the API function which tells us how
|
|---|
| 233 | far the implementation has come. The <tt>@status</tt> tag is intended
|
|---|
| 234 | to hold this information. The <tt>@status</tt> tag is used when
|
|---|
| 235 | automagically updating the Odin32 API Database. So while working on an
|
|---|
| 236 | API function, you'll have to update this field so it reflects the
|
|---|
| 237 | current implementation state of the function. (If you don't update it,
|
|---|
| 238 | the whole point is gone...)<p>
|
|---|
| 239 |
|
|---|
| 240 | The status is a set of keywords which describes the function state.
|
|---|
| 241 | (Additional words in the status field is ignored.)<p>
|
|---|
| 242 | ";
|
|---|
| 243 | TekstEnd();
|
|---|
| 244 |
|
|---|
| 245 | echo "
|
|---|
| 246 | <table border=3>
|
|---|
| 247 | <tr>
|
|---|
| 248 | <td width=5% align=right><font size=-1><b>%</b></font></td>
|
|---|
| 249 | <td><font size=-1><b>Keyword</b></font></td>
|
|---|
| 250 | <td width=70%><font size=-1><b>Description</b></font></td>
|
|---|
| 251 | </tr>
|
|---|
| 252 | ";
|
|---|
| 253 |
|
|---|
| 254 | require "Odin32DBConnect.php3";
|
|---|
| 255 | $sql = "SELECT\n".
|
|---|
| 256 | " name,\n".
|
|---|
| 257 | " description,\n".
|
|---|
| 258 | " weight,\n".
|
|---|
| 259 | " color\n".
|
|---|
| 260 | "FROM\n".
|
|---|
| 261 | " state\n".
|
|---|
| 262 | "ORDER BY refcode";
|
|---|
| 263 | $result = mysql_query($sql, $db);
|
|---|
| 264 | if ($result)
|
|---|
| 265 | {
|
|---|
| 266 | while ($aState = mysql_fetch_array($result))
|
|---|
| 267 | {
|
|---|
| 268 | echo "
|
|---|
| 269 | <tr>
|
|---|
| 270 | <td align=right valign=top><font size=-1>".$aState["weight"]."%</font></td>
|
|---|
| 271 | <td valign=top><font size=-1 color=".$aState["color"].">".$aState["name"]."</font></td>
|
|---|
| 272 | <td valign=top><font size=-1>".$aState["description"]."</font></td>
|
|---|
| 273 | </tr>";
|
|---|
| 274 | }
|
|---|
| 275 | }
|
|---|
| 276 | else
|
|---|
| 277 | Odin32DBSqlError($sql);
|
|---|
| 278 |
|
|---|
| 279 | echo "
|
|---|
| 280 | </table><p>\n";
|
|---|
| 281 |
|
|---|
| 282 | TekstBeg();
|
|---|
| 283 | echo "
|
|---|
| 284 | <b>Note:</b> The Open32 keyword should be used when the implementation
|
|---|
| 285 | of the API calls an Open32 function. Even if you''ve written 1000 lines
|
|---|
| 286 | of code fixing Open32 bugs, as long as it depends on Open32 directly in
|
|---|
| 287 | the implementation.<p>
|
|---|
| 288 |
|
|---|
| 289 | <b>Note2:</b> The <b>%</b> column in the table is the compleatage
|
|---|
| 290 | percent of a function in the given state.
|
|---|
| 291 | ";
|
|---|
| 292 | TekstEnd();
|
|---|
| 293 |
|
|---|
| 294 |
|
|---|
| 295 | /*
|
|---|
| 296 | * Design notes.
|
|---|
| 297 | */
|
|---|
| 298 | Odin32DBNaslov("Design Notes","design");
|
|---|
| 299 | TekstBeg();
|
|---|
| 300 | echo "
|
|---|
| 301 | <i>Experimental - expect addition/changes </i><p>
|
|---|
| 302 |
|
|---|
| 303 | From time to other someone will feel the urge to write a few (or many)
|
|---|
| 304 | lines about the design of a module, subsystem, tool or whatever, which
|
|---|
| 305 | isn't related to a specific function. For that purpose there is a
|
|---|
| 306 | tag, <tt>@design</tt>, which you can place whereever you whan't in the
|
|---|
| 307 | sourcecode, and write about how things work. The design notes are
|
|---|
| 308 | intented to be at a level higher than function or maybe even file
|
|---|
| 309 | level of documentation.<p>
|
|---|
| 310 |
|
|---|
| 311 | The <tt>@design</tt>-tag have a couple of options, which are used to
|
|---|
| 312 | order them and to give a title to the design note.<p>
|
|---|
| 313 |
|
|---|
| 314 | Syntax: <tt>@design <module sequence nbr> <design note title></tt><p>
|
|---|
| 315 |
|
|---|
| 316 | The <tt>module sequence nbr</tt> is a sequence number used to order
|
|---|
| 317 | the notes this for the module (ie. dll) when the designnotes are
|
|---|
| 318 | put together for an entire module.<p>
|
|---|
| 319 |
|
|---|
| 320 | The <tt>design note title</tt> is the title of the design note. This
|
|---|
| 321 | also used when the notes are collected for an entire module.<p>
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 | ";
|
|---|
| 325 | TekstEnd();
|
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 | /*
|
|---|
| 329 | * Class Documentation
|
|---|
| 330 | */
|
|---|
| 331 | Odin32DBNaslov("Classes and Methods (SDS)","classesandmethods");
|
|---|
| 332 | TekstBeg();
|
|---|
| 333 | echo "
|
|---|
| 334 | We need a way of describing and document classes and methods (class
|
|---|
| 335 | functions) in the Odin32 API. Though classes and methods are not exported
|
|---|
| 336 | directly in the API, they are used to implemented very much of it. For
|
|---|
| 337 | example the DDRAW and DSOUND DLL exports classes through function tables.<p>
|
|---|
| 338 |
|
|---|
| 339 | The following sub-sections is an excerpt from the SDS documentation adapted
|
|---|
| 340 | for use in Project Odin.
|
|---|
| 341 | ";
|
|---|
| 342 | TekstEnd();
|
|---|
| 343 |
|
|---|
| 344 | /*
|
|---|
| 345 | *
|
|---|
| 346 | */
|
|---|
| 347 | Odin32DBPodNaslov("Briefly About SDS", "aboutsds");
|
|---|
| 348 | TekstBeg();
|
|---|
| 349 | echo "
|
|---|
| 350 | SDS (Software Development Foundation) is designed (by Stig
|
|---|
| 351 | E. Sandøe) to be similar to JavaDoc but operate on C++, C, Java,
|
|---|
| 352 | Lisp, and other languages. It consists of a documentation style
|
|---|
| 353 | and a set of utilities which parses the source- and header-files and
|
|---|
| 354 | generates a set of HTML pages and class diagrams. We don't use the SDS
|
|---|
| 355 | tools yet, rather or homegrown stuff, the documentation style is very
|
|---|
| 356 | useful to attach some describing words to classes and their methods in
|
|---|
| 357 | a structured and uniform way.<p>
|
|---|
| 358 |
|
|---|
| 359 | The SDS documentation style is used by the win32k sources.
|
|---|
| 360 | For more on SDS look ";
|
|---|
| 361 | UrlLink("sds.sourceforge.net/", "here");
|
|---|
| 362 | echo ".\n";
|
|---|
| 363 | TekstEnd();
|
|---|
| 364 |
|
|---|
| 365 | /*
|
|---|
| 366 | * The Class-description Tags
|
|---|
| 367 | */
|
|---|
| 368 | Odin32DBPodNaslov("The Class-Description Tags", "sdsclasstags");
|
|---|
| 369 | TekstBeg();
|
|---|
| 370 | echo "
|
|---|
| 371 | An Example:
|
|---|
| 372 | ";
|
|---|
| 373 | TekstBeg();
|
|---|
| 374 |
|
|---|
| 375 | CodeBeg();
|
|---|
| 376 | echo "
|
|---|
| 377 | /**
|
|---|
| 378 | * @prop Here is the short description of class Foo
|
|---|
| 379 | * @desc Here is the description of class Foo
|
|---|
| 380 | * @purpose I describe the purpose of class Foo here.
|
|---|
| 381 | * @author Stig E. Sandoe.
|
|---|
| 382 | */
|
|---|
| 383 | class Foo
|
|---|
| 384 | {
|
|---|
| 385 | ...
|
|---|
| 386 | };";
|
|---|
| 387 | CodeEnd();
|
|---|
| 388 |
|
|---|
| 389 | /* A More Thorough Description */
|
|---|
| 390 | PodPodNaslov("A More Thorough Description");
|
|---|
| 391 | TekstBeg();
|
|---|
| 392 | echo "
|
|---|
| 393 | Classes has the following keywords:
|
|---|
| 394 | ";
|
|---|
| 395 | TekstEnd();
|
|---|
| 396 | echo "
|
|---|
| 397 | <table border=3>
|
|---|
| 398 | <tr>
|
|---|
| 399 | <td><b>Tag</b></td>
|
|---|
| 400 | <td><b>Description</b></td>
|
|---|
| 401 | </tr>
|
|---|
| 402 | <tr>
|
|---|
| 403 | <td><tt>@desc</tt></td>
|
|---|
| 404 | <td><font size=-1>
|
|---|
| 405 | Starts the general description-field for a class. (default)
|
|---|
| 406 | </font></td>
|
|---|
| 407 | <tr>
|
|---|
| 408 | <td><tt>@shortdesc</tt></td>
|
|---|
| 409 | <td><font size=-1>
|
|---|
| 410 | Short description (Alias: <tt>@memo</tt>)
|
|---|
| 411 | </font></td>
|
|---|
| 412 | <tr>
|
|---|
| 413 | <td><tt>@dstruct</tt></td>
|
|---|
| 414 | <td><font size=-1>
|
|---|
| 415 | Starts the field describing the data-structure of the class,
|
|---|
| 416 | and where it fits into the pig picture.
|
|---|
| 417 | </font></td>
|
|---|
| 418 | <tr>
|
|---|
| 419 | <td><tt>@version</tt></td>
|
|---|
| 420 | <td><font size=-1>
|
|---|
| 421 | Specifies the versionname/number of the class.
|
|---|
| 422 | (Alias: <tt>@vername</tt>)
|
|---|
| 423 | </font></td>
|
|---|
| 424 | <tr>
|
|---|
| 425 | <td><tt>@verdesc</tt></td>
|
|---|
| 426 | <td><font size=-1>
|
|---|
| 427 | Description of diffs in \"this\" version.
|
|---|
| 428 | </font></td>
|
|---|
| 429 | <tr>
|
|---|
| 430 | <td><tt>@author</tt></td>
|
|---|
| 431 | <td><font size=-1>
|
|---|
| 432 | Specifies the author of the class.
|
|---|
| 433 | </font></td>
|
|---|
| 434 | <tr>
|
|---|
| 435 | <td><tt>@approval</tt></td>
|
|---|
| 436 | <td><font size=-1>
|
|---|
| 437 | Specifies who have given final approval of the
|
|---|
| 438 | documentation/implementation of a class.
|
|---|
| 439 | </font></td>
|
|---|
| 440 | </table>
|
|---|
| 441 | ";
|
|---|
| 442 |
|
|---|
| 443 | /*
|
|---|
| 444 | * How to divide into categories
|
|---|
| 445 | */
|
|---|
| 446 | Odin32DBPodNaslov("How to divide into categories", "sdscat");
|
|---|
| 447 |
|
|---|
| 448 | TekstBeg();
|
|---|
| 449 | echo "
|
|---|
| 450 | The <tt>@cat</tt>-tag is really best illustrated with a short example:
|
|---|
| 451 | ";
|
|---|
| 452 | TekstEnd();
|
|---|
| 453 | CodeBeg();
|
|---|
| 454 | echo "
|
|---|
| 455 | class Foo
|
|---|
| 456 | {
|
|---|
| 457 | /** @cat Datamembers */
|
|---|
| 458 | int bar;
|
|---|
| 459 | int xyzzy;
|
|---|
| 460 |
|
|---|
| 461 | /** @cat Methods */
|
|---|
| 462 | int fubar() const;
|
|---|
| 463 | void IRS(long money=ALLMONEY) const;
|
|---|
| 464 | };";
|
|---|
| 465 | CodeEnd();
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 | /*
|
|---|
| 469 | * How To Document a Method
|
|---|
| 470 | */
|
|---|
| 471 | Odin32DBPodNaslov("How To Document a Method", "sdsmethod");
|
|---|
| 472 |
|
|---|
| 473 | TekstBeg();
|
|---|
| 474 | echo "
|
|---|
| 475 | <i>(This is similar to the SDS Function Header.)</i>
|
|---|
| 476 | ";
|
|---|
| 477 | TekstEnd();
|
|---|
| 478 |
|
|---|
| 479 | /* */
|
|---|
| 480 | PodPodNaslov("An Example");
|
|---|
| 481 | TekstBeg();
|
|---|
| 482 | echo "
|
|---|
| 483 | There are basically four places where you can put documentation for
|
|---|
| 484 | methods. New documentation found for a method is added/appended to
|
|---|
| 485 | the existing documentation so it is quite possible to describe
|
|---|
| 486 | different aspects fo a method in different places. Please note that
|
|---|
| 487 | documentation is added as it is read.<p>
|
|---|
| 488 | ";
|
|---|
| 489 | TekstEnd();
|
|---|
| 490 | CodeBeg();
|
|---|
| 491 | echo "
|
|---|
| 492 | class Foo
|
|---|
| 493 | {
|
|---|
| 494 | /** Documentation before the method */
|
|---|
| 495 | doFrob();
|
|---|
| 496 |
|
|---|
| 497 | int length() { /** Doc. inside the method */ ... }
|
|---|
| 498 | };
|
|---|
| 499 |
|
|---|
| 500 | /** More doc. before the mothod */
|
|---|
| 501 | Foo::doFrob()
|
|---|
| 502 | {
|
|---|
| 503 | /** Doc. inside the implementation */
|
|---|
| 504 | }";
|
|---|
| 505 | CodeEnd();
|
|---|
| 506 |
|
|---|
| 507 | /* A More Thorough Description */
|
|---|
| 508 | PodPodNaslov("A More Thorough Description");
|
|---|
| 509 | TekstBeg();
|
|---|
| 510 | echo "
|
|---|
| 511 | Methods have the following keywords:<p>
|
|---|
| 512 | ";
|
|---|
| 513 | TekstEnd();
|
|---|
| 514 | echo "
|
|---|
| 515 | <table border=3>
|
|---|
| 516 | <tr><td><b>Tag</b></td>
|
|---|
| 517 | <td><b>Description</b></td>
|
|---|
| 518 | </tr>
|
|---|
| 519 | <tr><td><tt>@desc</tt></font></td>
|
|---|
| 520 | <td><font size=-1>General description. (default)</td>
|
|---|
| 521 | </tr>
|
|---|
| 522 | <tr><td><tt>@return</tt></td>
|
|---|
| 523 | <td><font size=-1>What the function returns (Alias: @returns)</font></td>
|
|---|
| 524 | </tr>
|
|---|
| 525 | <tr><td><tt>@param <paramname></tt></td>
|
|---|
| 526 | <td><font size=-1>Parameters to the function.</font></td>
|
|---|
| 527 | </tr>
|
|---|
| 528 | <tr><td><tt>@status</tt></td>
|
|---|
| 529 | <td><font size=-1>
|
|---|
| 530 | Function status. See ";
|
|---|
| 531 | AnchNaslov("Function State.", "functionstate", "");
|
|---|
| 532 | echo "
|
|---|
| 533 | </font></td>
|
|---|
| 534 | </tr>
|
|---|
| 535 | <tr><td><tt>@time</tt></td>
|
|---|
| 536 | <td><font size=-1>Time complexity or estimated time use.</font></td>
|
|---|
| 537 | </tr>
|
|---|
| 538 | <tr><td><tt>@sketch</tt></td>
|
|---|
| 539 | <td><font size=-1>A sketch of the method, usually for design.</font></td>
|
|---|
| 540 | </tr>
|
|---|
| 541 | <tr><td><tt>@author</tt></td>
|
|---|
| 542 | <td><font size=-1>
|
|---|
| 543 | This is a list of authors. Authors are separated by ',' or
|
|---|
| 544 | by new-line. Make sure to use exactly the same name/signature
|
|---|
| 545 | each time.
|
|---|
| 546 | </font></td>
|
|---|
| 547 | </tr>
|
|---|
| 548 | <tr><td><tt>@remark</tt></td>
|
|---|
| 549 | <td><font size=-1>Any remarks.</font></td>
|
|---|
| 550 | </tr>
|
|---|
| 551 | </table>
|
|---|
| 552 | ";
|
|---|
| 553 |
|
|---|
| 554 | require "07-ColumnTwoFooter.php3";
|
|---|
| 555 | require "08-News.php3";
|
|---|
| 556 | require "09-ContentsTitle.php3";
|
|---|
| 557 |
|
|---|
| 558 | Odin32DBWriteContents();
|
|---|
| 559 |
|
|---|
| 560 | require "10-EndOfContent.php3";
|
|---|
| 561 | require "11-NetlabsContact.php3";
|
|---|
| 562 |
|
|---|
| 563 | $Kada=date ("j M Y", filemtime(__file__));
|
|---|
| 564 | require "12-OdinBanner.php3";
|
|---|
| 565 |
|
|---|
| 566 | require "13-Closing.php3";
|
|---|
| 567 |
|
|---|
| 568 | /* Profiling */
|
|---|
| 569 | Odin32DBTimerStop($sPageTimer);
|
|---|
| 570 | /* Profiling */
|
|---|
| 571 |
|
|---|
| 572 | ?>
|
|---|