<!DOCTYPE LINUXDOC SYSTEM>

<!-- This SGML file generated by cxref. -->
<!-- cxref program (c) Andrew M. Bishop 1995,96,97,98. -->

<article>

<title>Cross reference for html.c of cxref.
<author>cxref

<sect>File html.c
<bf>RCS Header: /home/amb/cxref/RCS/html.c 1.27 1999/01/28 19:19:36 amb Exp </bf>
<p>

  C Cross Referencing &amp; Documentation tool. Version 1.5.
<newline>
  Writes the HTML output.
<p>

<sect1>Included Files

<p>
<itemize>
<item><tt>#include &lt;stdlib.h&gt;</tt>
</itemize>
<itemize>
<item><tt>#include &lt;stdio.h&gt;</tt>
</itemize>
<itemize>
<item><tt>#include &lt;string.h&gt;</tt>
</itemize>
<itemize>
<item><tt>#include &lt;sys/types.h&gt;</tt>
</itemize>
<itemize>
<item><tt>#include &lt;sys/stat.h&gt;</tt>
</itemize>
<itemize>
<item><tt>#include &lt;unistd.h&gt;</tt>
</itemize>
<itemize>
<item><tt>#include &quot;memory.h&quot;</tt>
</itemize>
<itemize>
<item><tt>#include &quot;datatype.h&quot;</tt>
</itemize>
<itemize>
<item><tt>#include &quot;cxref.h&quot;</tt>
<itemize>
<item><tt>#include &quot;datatype.h&quot;</tt>
</itemize>
</itemize>

<sect1>Preprocessor definitions

<p>
 The file extension to use for the output files. 
<p>
<tt>#define HTML_FILE &quot;.html&quot;</tt><newline>
<p>
<tt>#define HTML_FILE_BACKUP &quot;.html&tilde;&quot;</tt><newline>
<p>
 The file extension to use for the output source files. 
<p>
<tt>#define HTML_SRC_FILE &quot;.src.html&quot;</tt><newline>
<p>
 The name of the output tex file that contains the appendix. 
<p>
<tt>#define HTML_APDX &quot;.apdx&quot;</tt><newline>
<p>
 A macro to determine the HTML version we should produce. 
<p>
<tt>#define HTML20</tt><newline>
<p>
<tt>#define HTML32</tt><newline>
<p>
<tt>#define HTMLSRC</tt><newline>

<sect1>External Variables

<p>
<bf>option_verbatim_comments</bf><newline>
 The comments are to be inserted verbatim. 
<p>
<tt>extern int option_verbatim_comments</tt><newline>
<descrip>
<tag>Defined in:</tag>
<itemize>
<item>option_verbatim_comments</itemize>
</descrip>
<p>
<bf>option_html</bf><newline>
 The type of HTML output to produce. 
<p>
<tt>extern int option_html</tt><newline>
<descrip>
<tag>Defined in:</tag>
<itemize>
<item>option_html</itemize>
</descrip>
<p>
<bf>option_odir</bf><newline>
 The name of the directory for the output. 
<p>
<tt>extern char* option_odir</tt><newline>
<descrip>
<tag>Defined in:</tag>
<itemize>
<item>option_odir</itemize>
</descrip>
<p>
<bf>option_name</bf><newline>
 The base name of the file for the output. 
<p>
<tt>extern char* option_name</tt><newline>
<descrip>
<tag>Defined in:</tag>
<itemize>
<item>option_name</itemize>
</descrip>

<sect1>Local Variables

<p>
<bf>goback</bf><newline>
 The directories to go back to get to the base output directory. 
<p>
<tt>static char* goback</tt><newline>
<descrip>
<tag>Used in:</tag>
<itemize>
<item>WriteHTMLFile()
<item>WriteHTMLFilePart()
<item>WriteHTMLFunction()
<item>WriteHTMLInclude()
<item>WriteHTMLSubInclude()
<item>WriteHTMLVariable()
</itemize>
</descrip>
<p>
<bf>of</bf><newline>
 The output file for the HTML. 
<p>
<tt>static FILE* of</tt><newline>
<descrip>
<tag>Used in:</tag>
<itemize>
<item>WriteHTMLAppendix()
<item>WriteHTMLDefine()
<item>WriteHTMLFile()
<item>WriteHTMLFilePart()
<item>WriteHTMLFunction()
<item>WriteHTMLInclude()
<item>WriteHTMLStructUnion()
<item>WriteHTMLSubInclude()
<item>WriteHTMLTypedef()
<item>WriteHTMLVariable()
</itemize>
</descrip>
<p>
<bf>filename</bf><newline>
 The name of the file. 
<p>
<tt>static char* filename</tt><newline>
<descrip>
<tag>Used in:</tag>
<itemize>
<item>WriteHTMLDefine()
<item>WriteHTMLFile()
<item>WriteHTMLFunction()
<item>WriteHTMLTypedef()
<item>WriteHTMLVariable()
</itemize>
</descrip>

<sect1>Global Function WriteHTMLAppendix()

<p>  Write out the appendix information.
<p>
<tt>void WriteHTMLAppendix ( StringList files, StringList2 funcs, StringList2 vars, StringList2 types )</tt><newline>
<descrip>
<tag><tt>StringList files</tt></tag>
The list of files to write.
<tag><tt>StringList2 funcs</tt></tag>
The list of functions to write.
<tag><tt>StringList2 vars</tt></tag>
The list of variables to write.
<tag><tt>StringList2 types</tt></tag>
The list of types to write.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>cxref.h
</itemize>
<tag>Calls:</tag>
<itemize>
<item>ConcatStrings()  :  memory.c
<item>WriteHTMLDocument()  :  html.c
<item>WriteHTMLPostamble()  :  html.c
<item>WriteHTMLPreamble()  :  html.c
<item>html()  :  html.c
<item>exit(), fclose(), fopen(), fprintf(), strncmp()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>main()  :  cxref.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>of  :  html.c
<item>option_name  :  cxref.c
<item>option_odir  :  cxref.c
</itemize>
</descrip>

<sect1>Global Function WriteHTMLFile()

<p>  Write an html file for a complete File structure and all components.
<p>
<tt>void WriteHTMLFile ( File file )</tt><newline>
<descrip>
<tag><tt>File file</tt></tag>
The File structure to output.
</descrip>
 The file structure is broken into its components and they are each written out. 
<p>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>cxref.h
</itemize>
<tag>Calls:</tag>
<itemize>
<item>ConcatStrings()  :  memory.c
<item>WriteHTMLDefine()  :  html.c
<item>WriteHTMLDocument()  :  html.c
<item>WriteHTMLFilePart()  :  html.c
<item>WriteHTMLFunction()  :  html.c
<item>WriteHTMLInclude()  :  html.c
<item>WriteHTMLPostamble()  :  html.c
<item>WriteHTMLPreamble()  :  html.c
<item>WriteHTMLSource()  :  html.c
<item>WriteHTMLTypedef()  :  html.c
<item>WriteHTMLVariable()  :  html.c
<item>html()  :  html.c
<item>exit(), fclose(), fopen(), fprintf(), mkdir(), stat(), strlen()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>main()  :  cxref.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>filename  :  html.c
<item>goback  :  html.c
<item>of  :  html.c
<item>option_html  :  cxref.c
<item>option_name  :  cxref.c
<item>option_odir  :  cxref.c
</itemize>
</descrip>

<sect1>Global Function WriteHTMLFileDelete()

<p>  Delete the HTML file and main file reference that belong to the named file.
<p>
<tt>void WriteHTMLFileDelete ( char* name )</tt><newline>
<descrip>
<tag><tt>char* name</tt></tag>
The name of the file to delete.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>cxref.h
</itemize>
<tag>Calls:</tag>
<itemize>
<item>ConcatStrings()  :  memory.c
<item>fclose(), fgets(), fopen(), fprintf(), fputs(), rename(), strcmp(), strlen(), strncmp(), unlink()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>main()  :  cxref.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>option_name  :  cxref.c
<item>option_odir  :  cxref.c
</itemize>
</descrip>

<sect1>Global Function WriteHTMLSource()

<p>  Write out the source file.
<p>
<tt>void WriteHTMLSource ( char* name )</tt><newline>
<descrip>
<tag><tt>char* name</tt></tag>
The name of the source file.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>ConcatStrings()  :  memory.c
<item>WriteHTMLPostamble()  :  html.c
<item>WriteHTMLPreamble()  :  html.c
<item>html()  :  html.c
<item>exit(), fclose(), fgets(), fopen(), fprintf(), fputs(), strcpy()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>option_odir  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLDefine()

<p>  Write a Define structure out.
<p>
<tt>static void WriteHTMLDefine ( Define def )</tt><newline>
<descrip>
<tag><tt>Define def</tt></tag>
The Define structure to output.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>html()  :  html.c
<item>fprintf()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>filename  :  html.c
<item>of  :  html.c
<item>option_html  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLDocument()

<p>  Write out a file that will include the current information.
<p>
<tt>static void WriteHTMLDocument ( char* name, int appendix )</tt><newline>
<descrip>
<tag><tt>char* name</tt></tag>
The name of the file.
<tag><tt>int appendix</tt></tag>
set to non-zero if the appendix file is to be added, else a normal source file.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>ConcatStrings()  :  memory.c
<item>WriteHTMLPostamble()  :  html.c
<item>WriteHTMLPreamble()  :  html.c
<item>exit(), fclose(), fgets(), fopen(), fprintf(), fputs(), rename(), strcmp(), strlen(), strncmp(), unlink()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLAppendix()  :  html.c
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>option_name  :  cxref.c
<item>option_odir  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLFilePart()

<p>  Write a File structure out.
<p>
<tt>static void WriteHTMLFilePart ( File file )</tt><newline>
<descrip>
<tag><tt>File file</tt></tag>
The File to output.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>html()  :  html.c
<item>fprintf(), strstr()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>goback  :  html.c
<item>of  :  html.c
<item>option_html  :  cxref.c
<item>option_verbatim_comments  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLFunction()

<p>  Write a Function structure out.
<p>
<tt>static void WriteHTMLFunction ( Function func )</tt><newline>
<descrip>
<tag><tt>Function func</tt></tag>
The Function structure to output.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>html()  :  html.c
<item>fprintf(), strcmp(), strncmp(), strstr()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>filename  :  html.c
<item>goback  :  html.c
<item>of  :  html.c
<item>option_html  :  cxref.c
<item>option_verbatim_comments  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLInclude()

<p>  Write an Include structure out.
<p>
<tt>static void WriteHTMLInclude ( Include inc )</tt><newline>
<descrip>
<tag><tt>Include inc</tt></tag>
The Include structure to output.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>WriteHTMLSubInclude()  :  html.c
<item>html()  :  html.c
<item>fprintf()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>goback  :  html.c
<item>of  :  html.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLPostamble()

<p>  Write out a standard post-amble. This includes the end of document marker.
<p>
<tt>static void WriteHTMLPostamble ( FILE* f, int sourcefile )</tt><newline>
<descrip>
<tag><tt>FILE* f</tt></tag>
The file to write the post amble to.
<tag><tt>int sourcefile</tt></tag>
True if the Source-Files line is to be included.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>fputs()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLAppendix()  :  html.c
<item>WriteHTMLDocument()  :  html.c
<item>WriteHTMLFile()  :  html.c
<item>WriteHTMLSource()  :  html.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLPreamble()

<p>  Write out a standard pre-amble.
<p>
<tt>static void WriteHTMLPreamble ( FILE* f, char* title, int sourcefile )</tt><newline>
<descrip>
<tag><tt>FILE* f</tt></tag>
The file to write the pre amble to.
<tag><tt>char* title</tt></tag>
The title of the file.
<tag><tt>int sourcefile</tt></tag>
True if the Source-Files line is to be included.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>fputs()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLAppendix()  :  html.c
<item>WriteHTMLDocument()  :  html.c
<item>WriteHTMLFile()  :  html.c
<item>WriteHTMLSource()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>option_html  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLStructUnion()

<p>  Write a structure / union structure out.
<p>
<tt>static void WriteHTMLStructUnion ( StructUnion su, int depth )</tt><newline>
<descrip>
<tag><tt>StructUnion su</tt></tag>
The structure / union to write.
<tag><tt>int depth</tt></tag>
The current depth within the structure.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>WriteHTMLStructUnion()  :  html.c
<item>html()  :  html.c
<item>fprintf(), strstr()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLStructUnion()  :  html.c
<item>WriteHTMLTypedef()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>of  :  html.c
<item>option_html  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLSubInclude()

<p>  Write an Sub Include structure out. (An include structure that is included from another file.)
<p>
<tt>static void WriteHTMLSubInclude ( Include inc, int depth )</tt><newline>
<descrip>
<tag><tt>Include inc</tt></tag>
The Include structure to output.
<tag><tt>int depth</tt></tag>
The depth of the include hierarchy.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>WriteHTMLSubInclude()  :  html.c
<item>html()  :  html.c
<item>fprintf()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLInclude()  :  html.c
<item>WriteHTMLSubInclude()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>goback  :  html.c
<item>of  :  html.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLTypedef()

<p>  Write a Typedef structure out.
<p>
<tt>static void WriteHTMLTypedef ( Typedef type )</tt><newline>
<descrip>
<tag><tt>Typedef type</tt></tag>
The Typedef structure to output.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>WriteHTMLStructUnion()  :  html.c
<item>html()  :  html.c
<item>fprintf(), strncmp()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>filename  :  html.c
<item>of  :  html.c
<item>option_html  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function WriteHTMLVariable()

<p>  Write a Variable structure out.
<p>
<tt>static void WriteHTMLVariable ( Variable var )</tt><newline>
<descrip>
<tag><tt>Variable var</tt></tag>
The Variable structure to output.
</descrip>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>html()  :  html.c
<item>fprintf()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLFile()  :  html.c
</itemize>
<tag>References Variables:</tag>
<itemize>
<item>filename  :  html.c
<item>goback  :  html.c
<item>of  :  html.c
<item>option_html  :  cxref.c
</itemize>
</descrip>

<sect1>Local Function html()

<p>  Make the input string safe to output as HTML ( not &lt;, &gt;, &amp; or &quot; ).
<p>
<tt>static char* html ( char* c )</tt><newline>
<descrip>
<tag><tt>char* html</tt></tag>
Returns a safe HTML string.
<tag><tt>char* c</tt></tag>
A non-safe HTML string.
</descrip>
  The function can only be called four times in each fprintf() since it returns one of only four static strings.
<p>
<descrip>
<tag>Prototyped in:</tag>
<itemize>
<item>html.c
</itemize>
<tag>Calls:</tag>
<itemize>
<item>CopyOrSkip()  :  warn-raw.c
<item>SafeFree()  :  memory.c
<item>SafeMalloc()  :  memory.c
<item>SafeRealloc()  :  memory.c
<item>strcpy(), strncpy()
</itemize>
<tag>Called by:</tag>
<itemize>
<item>WriteHTMLAppendix()  :  html.c
<item>WriteHTMLDefine()  :  html.c
<item>WriteHTMLFile()  :  html.c
<item>WriteHTMLFilePart()  :  html.c
<item>WriteHTMLFunction()  :  html.c
<item>WriteHTMLInclude()  :  html.c
<item>WriteHTMLSource()  :  html.c
<item>WriteHTMLStructUnion()  :  html.c
<item>WriteHTMLSubInclude()  :  html.c
<item>WriteHTMLTypedef()  :  html.c
<item>WriteHTMLVariable()  :  html.c
</itemize>
</descrip>

</article>
