<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Discworld MUD</title>
    <link href="/external/includes/style.css" rel="stylesheet" type="text/css">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <table border="0" width="95%">
        <tr>
          <td style="width:125px">
            <a href="/lpc/index.html"><img src="/external/images/logo_turtle.gif" style="border-style:none" alt="Home" width="110" height="106"></a>
          </td>
          <td valign="top">
            <br>
            <br>
            <script type="text/javascript" src="/external/includes/discworld.js"></script>
            <div id="textnav" style="visibility:hidden;position:absolute;">
              <a href="/lpc/about/">About</a>  | <a href="/lpc/playing/">Playing</a>  | <a href="/lpc/~Playtesters/">Playtesting</a>  | <a href="/lpc/creating/">Creating</a>  | <a href="/lpc/links/">Links</a> 
              <!--%textsubmenu%-->
            </div>
          </td>
        </tr>
        <tr>
          <td valign="top" style="width:125px">
            <!--%login%-->
          <p style="text-align:center" class="menu"><a href="javascript:popup('/external/java/newtelnet/java_client.shtml','JavaClient', 'width=800,height=600,resizable=yes,scrollbar=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')">Play Now</a></p>

          </td>
          <td valign="top">


[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /obj/handlers/autodoc/autodoc_handler.c</h2>
Documentation system for removing documentation from source files.
<p>
The documentation will be created in the directory /doc/autodoc.  Extra
documentation should be placed into the other help directories and will
be accessed via the help system.  The html documentation will be placed
into the /www/autodoc directory.  The files in theses directories will
be named with the '/'s replaced with '.'s.  ie: /obj/handlers/room_handler.c
would be in the file /doc/autodoc/obj.handlers.room_handler.c and
/www/autodoc/obj.handlers.room_handler.c.shtml.  An index of the methods
and object names will be generated from the input files and linked into the
help system.  An alphabetical index will also be produced that is linked
to the html stuff.
<p>
The first comment which follows the comment format below and occurs right
before a function will be used as the documentation for that function.  The
comment must start with two '*'s to distinguish it from a normal comment.
A special tag at the start of one of the first comments in the file will
signify that it is a comment for the class.
<p>
Only comments before a real function declaration will be used, comments
before a predeclaration will be ignored.
<p>
Any function which is not declared as private and does not have the @ignore
tag in its description will be placed into the resulting documentation
file.  This will be done even if no comment was found.
<p>
In the text part of the comment the main section is a free form
documentation, it is merely a description of the whole function.  After
this several tags can be added to the comment which allows other things
to be documented.  All the text after the tag is taken as part of that
tags information.  The main tag should never actually be used, it
is implied as being the tag associated with the first section of
comment.
<p>
HTML tags will be used in the comments to allow certain things to
happen.  The tags 'p', 'b', 'i', 'code', 'ul', 'ol', 'dl', 'dd', 'dt', 'pre'
and 'li' will be supported.
<p>
The sequences '/', '\' and '\<' will be processed by the comment
handling code so that they do not get placed into the output code.
<p>
White space is ignored...  Both html and dw nroff format files will be
created from the documentation maker.
<p>
The supported tags are:
<dl>
<dt>@param
<dd>Specify the parameter and what it does.  This should be one short
    sentance only.  There needs to be one of these for every
    parameter, the first word of the sentance is the name of the 
    paramater and the rest is the descrption.  There should be no full
    stop on the end of the sentance.
<dt>@member
<dd>This is used with classes and defines the members of the class.  The
    definition is the same as for the @param element above.
<dt>@return
<dd>Specify what the return value is.  This should be one short
    sentance only.  Theres should only be one of these in every
    function.  There should be no full stop on the end of the sentance.
<dt>@see
  <dd>Specify an object or function to see.  The format must be one of:
  <ul>
  <li> object_name<br><i>@see /global/new_parse</i>
  <li> function_name()<br><i>@see frog()</i>
  <li> object_name->function_name()<br><i>@see /global/new_parse->add_command()</i>
  <li> efun::name()<br><i>@see efun::sort_array()</i>
  <li> help::name<br>@see help::effects
  </ul>
<dt>@ignore
  <dd>Do not document this function, the whole comment is ignored.
<dt>@main
  <dd>The main documentation section.
<dt>@classification
   <dd>Used in the effects files to classifiy the effect.  So a tree
     of the classifications can be derived.
<dt>@index
       <dd>Adds in a new index refernece on this name.  This should be one
           word only.
<dt>@change
  <dd>Placed in the class documentation to reference a change list.
           First line after the tag is the date and the author and
           then follows a description of the change.
<dt>@example
  <dd>If you wish to embed an example in the code.
<dt>@started
  <dd>When the file was started.
<dt>@author
  <dd>The author of the file.
</dl>

The output format will look something like the API documentation for
java.  If you have not seen this before, go to http://www.javasoft.com
and look in the JDK and then the API section.
<p>
Comment format:
<pre>
/**
 *  <text>
 *    ..
 *  <text>
 *
 */
</pre>

ie: it starts with a /** and ends with a */ on a line by themselves and
every intervening line has a * at the start.  By using a \ you can
make characters escaped.  This means they are not processed by
the internal system, so to make a end comment appear inside a
the text you go : */
<p><b>See also:</b><br>/obj/handlers/autodoc/autodoc_file.c, /obj/handlers/autodoc/autodoc_nroff.c and /obj/handlers/autodoc/autodoc_html.c<br /><p>Written by Pinkfish<p>Started Tue Oct 28 13:25:09 EST 1997

<h3>Example</h3>
<pre>inherit "/std/object";

/**
 *   This class is a nice shade of blue and allows all other shades of
 *   green and yellow to mix well.
 * @see yellow
 * @see blue
 * @change 12/3/97 Pinkfish
 *    Pushed some of the yellow stuff down a hole and ate a bagel.
 */

/**
 * This method mixes the green in with our blue.
 * @param  green   the green object to mix.
 */
void mixGreen(object green) {
  /* Something wild and exciting! */
} /* mixGreen() */

/**
 * This method mixes the yellow in with our blue.
 * @param  yellow the yellow object to mix.
 * @return returns a TRUE or FALSE depending on if the mix succeeded.
 * @example
 *   mixYellow(12);
 */
int mixYellow(object yellow) {
} /* mixYellow() */
</pre>
<h2>Includes</h2>
This class includes the following files /include/autodoc.h<h2>Method index</h2>
<ul>
<li><a href="#add_file">add_file</a>(string)<br/>
Adds a file into the list of files to process for autodocumentation.
<li><a href="#create_index_1">create_index_1</a>(int)<li><a href="#create_index_2">create_index_2</a>(int)<li><a href="#is_autodoc_file">is_autodoc_file</a>(string)<br/>
This method tells us if the file is currently in the autodoc set.
<li><a href="#query_files">query_files</a>()<br/>
Returns the list of files we are current processing.
<li><a href="#query_help_map">query_help_map</a>()<br/>
Returns the help mapping.
<li><a href="#query_help_on">query_help_on</a>(string, string)<br/>
This method returns the file name of the help for the specified
function in the specified file.
<li><a href="#query_summary_map">query_summary_map</a>()<br/>
Retuirns the mapping of file names to a summary.
<li><a href="#recreate_documentation">recreate_documentation</a>(string)<br/>
Recreate documentation for one file immediately.
<li><a href="#recreate_indexes">recreate_indexes</a>()<br/>
Regenerate the index files.
<li><a href="#remove_file">remove_file</a>(string)<br/>
Removes a file from the list of files to be processed for autodocumentation.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_file">
add_file</a><pre class="autodocfuncdef">
int add_file(string fname)
</pre><dd><br />
Adds a file into the list of files to process for autodocumentation.
This file will be processed every time around in the autodocumentation
loop to check to see if it has been changed and the results will be
placed into the index.  It automaticly calls recreate_documentation
in random(60) seconds.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
fname - the name of the file to add
<br />
<br />
<dd><b>Returns:</b>
<br />1 if the add succeeds, 0 otherwise.
<br /><br />
<dd><b>See also:</b>
<br /><a href="#recreate_documentation">recreate_documentation()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="create_index_1">
create_index_1</a><pre class="autodocfuncdef">
void create_index_1(int i)
</pre>
<dt class="autodocfuncname"><a name="create_index_2">
create_index_2</a><pre class="autodocfuncdef">
void create_index_2(int i)
</pre>
<dt class="autodocfuncname"><a name="is_autodoc_file">
is_autodoc_file</a><pre class="autodocfuncdef">
int is_autodoc_file(string name)
</pre><dd><br />
This method tells us if the file is currently in the autodoc set.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 if the file is found, 0 if not
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_files">
query_files</a><pre class="autodocfuncdef">
string * query_files()
</pre><dd><br />
Returns the list of files we are current processing.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />an array of strings being the file names
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_help_map">
query_help_map</a><pre class="autodocfuncdef">
mapping query_help_map()
</pre><dd><br />
Returns the help mapping.  This is the mapping from function names to
files.  Each element in the mapping referes to an array of file
names which contain the function or define.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />a mapping of arrays of files
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_help_on">
query_help_on</a><pre class="autodocfuncdef">
string query_help_on(string file,
                     string func)
</pre><dd><br />
This method returns the file name of the help for the specified
function in the specified file.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
file - the file name to find the help in<br />
func - the function to look for help on in the file<br />
<br />
<dd><b>Returns:</b>
<br />the full path to the help file, 0 if it does not exist
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_summary_map">
query_summary_map</a><pre class="autodocfuncdef">
mapping query_summary_map()
</pre><dd><br />
Retuirns the mapping of file names to a summary.  This is only
valid during the index creation cycle of the documentation generation
system.  It is used to create a more useful index page.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the mapping of file names to summarys
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="recreate_documentation">
recreate_documentation</a><pre class="autodocfuncdef">
int recreate_documentation(string fname)
</pre><dd><br />
Recreate documentation for one file immediately.  This does not update
the index, it merely creates the base files for this file.  It does it
at a random delay of up to 30 seconds.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
fname - the file name to update
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="recreate_indexes">
recreate_indexes</a><pre class="autodocfuncdef">
void recreate_indexes()
</pre><dd><br />
Regenerate the index files.
<br />

<dt class="autodocfuncname"><a name="remove_file">
remove_file</a><pre class="autodocfuncdef">
int remove_file(string fname)
</pre><dd><br />
Removes a file from the list of files to be processed for autodocumentation.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
fname - the name of the file to remove
<br />
<br />
<dd><b>Returns:</b>
<br />1 if the remove succeeds, 0 otherwise.
<br /><br />
<br /></dl>

</dl>
</td>
</tr>
<tr>
<td valign="bottom" align="center">
<table>
<tr>
<td align="center" class="imgcell">
<a href="http://validator.w3.org/check?uri=referer"><img src="/external/images/valid-html401" alt="Valid HTML 4.01 Transitional" height=31 width=88 border=0></a>
</td>
</tr>
<tr>
<td align="center" class="imgcell">
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img height="31" width="88" style="border-style:none" src="/external/images/vcss" alt="Valid CSS!"></a>
</td>
</tr>
<tr>
<td align="center">
<a href="/lpc/html_css.html" style="font-size:smaller">Read More</a>
</td>
</tr>
</table>
</td>
<td align="left" valign="top">
<h3></h3>
<p class="copyright">Brought to you by CMOT Dibbler's <a href="/lpc/sausages.html">Sensational Sausages</a>; buy one while they're hot.<br>
Copyright &copy; Discworld MUD, <a href="javascript:popup('/external/java/newtelnet/java_client.shtml','JavaClient', 'width=800,height=600,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')">Play Now</a>, <a href="http://www.topmudsites.com/cgi-bin/topmuds/rankem.cgi?action=in&amp;id=pinkfish" rel="external">Vote</a>.</p>
</td>
</tr>
</table>
</body>
</html>

