% This LaTeX file generated by cxref
% cxref program (c) Andrew M. Bishop 1995,96,97.

\markboth{File cxref.c}{File cxref.c}
\section{File cxref.c}
\label{file_cxref.c}

{\bf RCS Header: /home/amb/cxref/RCS/cxref.c 1.45 1999/01/26 19:40:12 amb Exp }

\smallskip

  C Cross Referencing \& Documentation tool. Version 1.5.


\subsection*{Included Files}

\begin{cxreftabi}
{\stt \#include <stdio.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include <stdlib.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include <string.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include <sys/types.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include <sys/wait.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include <sys/stat.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include <unistd.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include "parse-yy.h"} &\cxreffile{parse-yy.h}\\
\hspace*{0.2in}{\stt \#include <stdio.h>} &\\
\hspace*{0.2in}{\stt \#include <stdlib.h>} &\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include "memory.h"} &\cxreffile{memory.h}\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include "datatype.h"} &\cxreffile{datatype.h}\\
\end{cxreftabi}

\medskip
\begin{cxreftabi}
{\stt \#include "cxref.h"} &\cxreffile{cxref.h}\\
\hspace*{0.2in}{\stt \#include "datatype.h"} &\cxreffile{datatype.h}\\
\end{cxreftabi}


\subsection*{Preprocessor definitions}

 The default value of the CPP command. 

\smallskip
{\stt \#define CPP\_COMMAND "gcc -E -C -dD -dI"}

\medskip
 The name of the file to read the configuration from. 

\smallskip
{\stt \#define CXREF\_CONFIG\_FILE ".cxref"}


\subsection{Variables}


\subsubsection{Variable option\_all\_comments}
\label{var_option_all_comments_cxref.c}

 The command line switch that sets the format of the output,   use all comments. 

\smallskip
{\stt int option\_all\_comments}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & parse-lex.c & \ & \cxreffile{parse-lex.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & yylex() & parse-lex.c & \cxreffunc{yylex}{parse-lex.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_verbatim\_comments}
\label{var_option_verbatim_comments_cxref.c}

 The command line switch that sets the format of the output,   insert the comments verbatim into the output. 

\smallskip
{\stt int option\_verbatim\_comments}

\smallskip
\begin{cxreftabiii}
Visible in:\ & comment.c & \ & \cxreffile{comment.c}\\
\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & html.c & \ & \cxreffile{html.c}\\
\ & latex.c & \ & \cxreffile{latex.c}\\
\cxreftabbreak{cxreftabiii}
\ & rtf.c & \ & \cxreffile{rtf.c}\\
\ & sgml.c & \ & \cxreffile{sgml.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & SeenComment() & comment.c & \cxreffunc{SeenComment}{comment.c}\\
\ & WriteHTMLFilePart() & html.c & \cxreffunc{WriteHTMLFilePart}{html.c}\\
\ & WriteHTMLFunction() & html.c & \cxreffunc{WriteHTMLFunction}{html.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteLatexFilePart() & latex.c & \cxreffunc{WriteLatexFilePart}{latex.c}\\
\ & WriteLatexFunction() & latex.c & \cxreffunc{WriteLatexFunction}{latex.c}\\
\ & WriteRTFFilePart() & rtf.c & \cxreffunc{WriteRTFFilePart}{rtf.c}\\
\ & WriteRTFFunction() & rtf.c & \cxreffunc{WriteRTFFunction}{rtf.c}\\
\ & WriteSGMLFilePart() & sgml.c & \cxreffunc{WriteSGMLFilePart}{sgml.c}\\
\ & WriteSGMLFunction() & sgml.c & \cxreffunc{WriteSGMLFunction}{sgml.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_block\_comments}
\label{var_option_block_comments_cxref.c}

 The command line switch that sets the format of the output,   remove the leading block comment marker. 

\smallskip
{\stt int option\_block\_comments}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & parse-lex.c & \ & \cxreffile{parse-lex.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & yylex() & parse-lex.c & \cxreffunc{yylex}{parse-lex.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_no\_comments}
\label{var_option_no_comments_cxref.c}

 The command line switch that sets the format of the output,   ignore all comments. 

\smallskip
{\stt int option\_no\_comments}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & parse-lex.c & \ & \cxreffile{parse-lex.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & yylex() & parse-lex.c & \cxreffunc{yylex}{parse-lex.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_xref}
\label{var_option_xref_cxref.c}

 The command line switch that sets the format of the output,   do cross referencing. 

\smallskip
{\stt int option\_xref}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & func.c & \ & \cxreffile{func.c}\\
\ & warn-raw.c & \ & \cxreffile{warn-raw.c}\\
\ & xref.c & \ & \cxreffile{xref.c}\\
Used in:\ & CheckFunctionVariableRef() & func.c & \cxreffunc{CheckFunctionVariableRef}{func.c}\\
\ & CrossReference() & xref.c & \cxreffunc{CrossReference}{xref.c}\\
\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & SeenFunctionCall() & func.c & \cxreffunc{SeenFunctionCall}{func.c}\\
\cxreftabbreak{cxreftabiii}
\ & SeenFunctionDefinition() & func.c & \cxreffunc{SeenFunctionDefinition}{func.c}\\
\ & SeenFunctionProto() & func.c & \cxreffunc{SeenFunctionProto}{func.c}\\
\ & WriteWarnRawFilePart() & warn-raw.c & \cxreffunc{WriteWarnRawFilePart}{warn-raw.c}\\
\ & WriteWarnRawFunction() & warn-raw.c & \cxreffunc{WriteWarnRawFunction}{warn-raw.c}\\
\ & WriteWarnRawVariable() & warn-raw.c & \cxreffunc{WriteWarnRawVariable}{warn-raw.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_warn}
\label{var_option_warn_cxref.c}

 The command line switch that sets the format of the output,   produce warnings. 

\smallskip
{\stt int option\_warn}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & parse-lex.c & \ & \cxreffile{parse-lex.c}\\
\ & warn-raw.c & \ & \cxreffile{warn-raw.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & WriteWarnRawAppendix() & warn-raw.c & \cxreffunc{WriteWarnRawAppendix}{warn-raw.c}\\
\ & WriteWarnRawDefine() & warn-raw.c & \cxreffunc{WriteWarnRawDefine}{warn-raw.c}\\
\ & WriteWarnRawFilePart() & warn-raw.c & \cxreffunc{WriteWarnRawFilePart}{warn-raw.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteWarnRawFunction() & warn-raw.c & \cxreffunc{WriteWarnRawFunction}{warn-raw.c}\\
\ & WriteWarnRawInclude() & warn-raw.c & \cxreffunc{WriteWarnRawInclude}{warn-raw.c}\\
\ & WriteWarnRawStructUnion() & warn-raw.c & \cxreffunc{WriteWarnRawStructUnion}{warn-raw.c}\\
\ & WriteWarnRawTypedef() & warn-raw.c & \cxreffunc{WriteWarnRawTypedef}{warn-raw.c}\\
\ & WriteWarnRawVariable() & warn-raw.c & \cxreffunc{WriteWarnRawVariable}{warn-raw.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & yylex() & parse-lex.c & \cxreffunc{yylex}{parse-lex.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_index}
\label{var_option_index_cxref.c}

 The command line switch that sets the format of the output,   produce an index. 

\smallskip
{\stt int option\_index}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & warn-raw.c & \ & \cxreffile{warn-raw.c}\\
\ & xref.c & \ & \cxreffile{xref.c}\\
Used in:\ & CreateAppendix() & xref.c & \cxreffunc{CreateAppendix}{xref.c}\\
\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & WriteWarnRawAppendix() & warn-raw.c & \cxreffunc{WriteWarnRawAppendix}{warn-raw.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_raw}
\label{var_option_raw_cxref.c}

 The command line switch that sets the format of the output,   produce raw output. 

\smallskip
{\stt int option\_raw}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & warn-raw.c & \ & \cxreffile{warn-raw.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & WriteWarnRawDefine() & warn-raw.c & \cxreffunc{WriteWarnRawDefine}{warn-raw.c}\\
\ & WriteWarnRawFile() & warn-raw.c & \cxreffunc{WriteWarnRawFile}{warn-raw.c}\\
\ & WriteWarnRawFilePart() & warn-raw.c & \cxreffunc{WriteWarnRawFilePart}{warn-raw.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteWarnRawFunction() & warn-raw.c & \cxreffunc{WriteWarnRawFunction}{warn-raw.c}\\
\ & WriteWarnRawInclude() & warn-raw.c & \cxreffunc{WriteWarnRawInclude}{warn-raw.c}\\
\ & WriteWarnRawStructUnion() & warn-raw.c & \cxreffunc{WriteWarnRawStructUnion}{warn-raw.c}\\
\ & WriteWarnRawTypedef() & warn-raw.c & \cxreffunc{WriteWarnRawTypedef}{warn-raw.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteWarnRawVariable() & warn-raw.c & \cxreffunc{WriteWarnRawVariable}{warn-raw.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_latex}
\label{var_option_latex_cxref.c}

 The command line switch that sets the format of the output,   produce LaTeX output. 

\smallskip
{\stt int option\_latex}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & latex.c & \ & \cxreffile{latex.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & WriteLatexTemplate() & latex.c & \cxreffunc{WriteLatexTemplate}{latex.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_html}
\label{var_option_html_cxref.c}

 The command line switch that sets the format of the output,   produce HTML output. 

\smallskip
{\stt int option\_html}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & html.c & \ & \cxreffile{html.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & WriteHTMLDefine() & html.c & \cxreffunc{WriteHTMLDefine}{html.c}\\
\ & WriteHTMLFile() & html.c & \cxreffunc{WriteHTMLFile}{html.c}\\
\ & WriteHTMLFilePart() & html.c & \cxreffunc{WriteHTMLFilePart}{html.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteHTMLFunction() & html.c & \cxreffunc{WriteHTMLFunction}{html.c}\\
\ & WriteHTMLPreamble() & html.c & \cxreffunc{WriteHTMLPreamble}{html.c}\\
\ & WriteHTMLStructUnion() & html.c & \cxreffunc{WriteHTMLStructUnion}{html.c}\\
\ & WriteHTMLTypedef() & html.c & \cxreffunc{WriteHTMLTypedef}{html.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteHTMLVariable() & html.c & \cxreffunc{WriteHTMLVariable}{html.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_rtf}
\label{var_option_rtf_cxref.c}

 The command line switch that sets the format of the output,   produce RTF output. 

\smallskip
{\stt int option\_rtf}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_sgml}
\label{var_option_sgml_cxref.c}

 The command line switch that sets the format of the output,   produce SGML output. 

\smallskip
{\stt int option\_sgml}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_odir}
\label{var_option_odir_cxref.c}

 The command line switch for the output name,   the directory to use. 

\smallskip
{\stt char* option\_odir}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & html.c & \ & \cxreffile{html.c}\\
\ & latex.c & \ & \cxreffile{latex.c}\\
\ & rtf.c & \ & \cxreffile{rtf.c}\\
\cxreftabbreak{cxreftabiii}
\ & sgml.c & \ & \cxreffile{sgml.c}\\
\ & xref.c & \ & \cxreffile{xref.c}\\
Used in:\ & CreateAppendix() & xref.c & \cxreffunc{CreateAppendix}{xref.c}\\
\ & CrossReference() & xref.c & \cxreffunc{CrossReference}{xref.c}\\
\ & CrossReferenceDelete() & xref.c & \cxreffunc{CrossReferenceDelete}{xref.c}\\
\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteHTMLAppendix() & html.c & \cxreffunc{WriteHTMLAppendix}{html.c}\\
\ & WriteHTMLDocument() & html.c & \cxreffunc{WriteHTMLDocument}{html.c}\\
\ & WriteHTMLFile() & html.c & \cxreffunc{WriteHTMLFile}{html.c}\\
\ & WriteHTMLFileDelete() & html.c & \cxreffunc{WriteHTMLFileDelete}{html.c}\\
\ & WriteHTMLSource() & html.c & \cxreffunc{WriteHTMLSource}{html.c}\\
\ & WriteLatexAppendix() & latex.c & \cxreffunc{WriteLatexAppendix}{latex.c}\\
\ & WriteLatexDocument() & latex.c & \cxreffunc{WriteLatexDocument}{latex.c}\\
\ & WriteLatexFile() & latex.c & \cxreffunc{WriteLatexFile}{latex.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteLatexFileDelete() & latex.c & \cxreffunc{WriteLatexFileDelete}{latex.c}\\
\ & WriteLatexTemplate() & latex.c & \cxreffunc{WriteLatexTemplate}{latex.c}\\
\ & WriteRTFAppendix() & rtf.c & \cxreffunc{WriteRTFAppendix}{rtf.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteRTFFile() & rtf.c & \cxreffunc{WriteRTFFile}{rtf.c}\\
\ & WriteRTFFileDelete() & rtf.c & \cxreffunc{WriteRTFFileDelete}{rtf.c}\\
\ & WriteSGMLAppendix() & sgml.c & \cxreffunc{WriteSGMLAppendix}{sgml.c}\\
\ & WriteSGMLFile() & sgml.c & \cxreffunc{WriteSGMLFile}{sgml.c}\\
\ & WriteSGMLFileDelete() & sgml.c & \cxreffunc{WriteSGMLFileDelete}{sgml.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_name}
\label{var_option_name_cxref.c}

 The command line switch for the output name,   the base part of the name. 

\smallskip
{\stt char* option\_name}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & html.c & \ & \cxreffile{html.c}\\
\ & latex.c & \ & \cxreffile{latex.c}\\
\ & rtf.c & \ & \cxreffile{rtf.c}\\
\cxreftabbreak{cxreftabiii}
\ & sgml.c & \ & \cxreffile{sgml.c}\\
\ & xref.c & \ & \cxreffile{xref.c}\\
Used in:\ & CreateAppendix() & xref.c & \cxreffunc{CreateAppendix}{xref.c}\\
\ & CrossReference() & xref.c & \cxreffunc{CrossReference}{xref.c}\\
\ & CrossReferenceDelete() & xref.c & \cxreffunc{CrossReferenceDelete}{xref.c}\\
\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteHTMLAppendix() & html.c & \cxreffunc{WriteHTMLAppendix}{html.c}\\
\ & WriteHTMLDocument() & html.c & \cxreffunc{WriteHTMLDocument}{html.c}\\
\ & WriteHTMLFile() & html.c & \cxreffunc{WriteHTMLFile}{html.c}\\
\ & WriteHTMLFileDelete() & html.c & \cxreffunc{WriteHTMLFileDelete}{html.c}\\
\ & WriteLatexAppendix() & latex.c & \cxreffunc{WriteLatexAppendix}{latex.c}\\
\ & WriteLatexDocument() & latex.c & \cxreffunc{WriteLatexDocument}{latex.c}\\
\ & WriteLatexFileDelete() & latex.c & \cxreffunc{WriteLatexFileDelete}{latex.c}\\
\ & WriteRTFAppendix() & rtf.c & \cxreffunc{WriteRTFAppendix}{rtf.c}\\
\ & WriteSGMLAppendix() & sgml.c & \cxreffunc{WriteSGMLAppendix}{sgml.c}\\
\ & WriteSGMLFile() & sgml.c & \cxreffunc{WriteSGMLFile}{sgml.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_root}
\label{var_option_root_cxref.c}

 The command line switch for the output name,   the source tree root directory. 

\smallskip
{\stt char* option\_root}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_incdirs}
\label{var_option_incdirs_cxref.c}

 The name of the include directories specified on the command line. 

\smallskip
{\stt char** option\_incdirs}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & preproc.c & \ & \cxreffile{preproc.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & SeenInclude() & preproc.c & \cxreffunc{SeenInclude}{preproc.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable option\_nincdirs}
\label{var_option_nincdirs_cxref.c}

 The number of include directories on the command line. 

\smallskip
{\stt int option\_nincdirs}

\smallskip
\begin{cxreftabiii}
Visible in:\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & preproc.c & \ & \cxreffile{preproc.c}\\
Used in:\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & SeenInclude() & preproc.c & \cxreffunc{SeenInclude}{preproc.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Variable CurFile}
\label{var_CurFile_cxref.c}

 The current file that is being processed. 

\smallskip
{\stt File CurFile}

\smallskip
\begin{cxreftabiii}
Visible in:\ & comment.c & \ & \cxreffile{comment.c}\\
\ & cxref.c & \ & \cxreffile{cxref.c}\\
\ & file.c & \ & \cxreffile{file.c}\\
\ & func.c & \ & \cxreffile{func.c}\\
\cxreftabbreak{cxreftabiii}
\ & preproc.c & \ & \cxreffile{preproc.c}\\
\ & type.c & \ & \cxreffile{type.c}\\
\ & var.c & \ & \cxreffile{var.c}\\
Used in:\ & CheckFunctionVariableRef() & func.c & \cxreffunc{CheckFunctionVariableRef}{func.c}\\
\ & ResetFunctionAnalyser() & func.c & \cxreffunc{ResetFunctionAnalyser}{func.c}\\
\ & SeenComment() & comment.c & \cxreffunc{SeenComment}{comment.c}\\
\ & SeenDefine() & preproc.c & \cxreffunc{SeenDefine}{preproc.c}\\
\cxreftabbreak{cxreftabiii}
\ & SeenFileComment() & file.c & \cxreffunc{SeenFileComment}{file.c}\\
\ & SeenFunctionDefinition() & func.c & \cxreffunc{SeenFunctionDefinition}{func.c}\\
\ & SeenInclude() & preproc.c & \cxreffunc{SeenInclude}{preproc.c}\\
\ & SeenStructUnionComp() & type.c & \cxreffunc{SeenStructUnionComp}{type.c}\\
\ & SeenStructUnionEnd() & type.c & \cxreffunc{SeenStructUnionEnd}{type.c}\\
\ & SeenTypedef() & type.c & \cxreffunc{SeenTypedef}{type.c}\\
\ & SeenVariableDefinition() & var.c & \cxreffunc{SeenVariableDefinition}{var.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Local Variables}

{\bf cpp\_command}
\label{var_cpp_command_cxref.c}

 The actual cpp command that is built up, adding -D, -U and -I options. 

\smallskip
{\stt static char** cpp\_command}

\smallskip
\begin{cxreftabiii}
Used in:\ & DocumentTheFile() & \ & \cxreffunc{DocumentTheFile}{cxref.c}\\
\ & ParseOptions() & \ & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & \ & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}

\medskip
{\bf cpp\_command\_num}
\label{var_cpp_command_num_cxref.c}

 The number of arguments to the cpp command. 

\smallskip
{\stt static int cpp\_command\_num}

\smallskip
\begin{cxreftabiii}
Used in:\ & DocumentTheFile() & \ & \cxreffunc{DocumentTheFile}{cxref.c}\\
\ & ParseOptions() & \ & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & \ & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}

\medskip
{\bf cpp\_argument\_num}
\label{var_cpp_argument_num_cxref.c}

 The number of arguments to the -CPP argument. 

\smallskip
{\stt static int cpp\_argument\_num}

\smallskip
\begin{cxreftabiii}
Used in:\ & ParseOptions() & \ & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & \ & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}

\medskip
{\bf option\_delete}
\label{var_option_delete_cxref.c}

 The option to control the mode of operation. 

\smallskip
{\stt static int option\_delete}

\smallskip
\begin{cxreftabiii}
Used in:\ & ParseOptions() & \ & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & \ & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}

\medskip
{\bf option\_files}
\label{var_option_files_cxref.c}

 The names of the files to process. 

\smallskip
{\stt static char** option\_files}

\smallskip
\begin{cxreftabiii}
Used in:\ & ParseConfigFile() & \ & \cxreffunc{ParseConfigFile}{cxref.c}\\
\ & ParseOptions() & \ & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & \ & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}

\medskip
{\bf option\_nfiles}
\label{var_option_nfiles_cxref.c}

 The number of files to process. 

\smallskip
{\stt static int option\_nfiles}

\smallskip
\begin{cxreftabiii}
Used in:\ & ParseConfigFile() & \ & \cxreffunc{ParseConfigFile}{cxref.c}\\
\ & ParseOptions() & \ & \cxreffunc{ParseOptions}{cxref.c}\\
\ & main() & \ & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}

\medskip
{\bf popen\_pid}
\label{var_popen_pid_cxref.c}

 The process id of the pre-processor. 

\smallskip
{\stt static pid\_t popen\_pid}

\smallskip
\begin{cxreftabiii}
Used in:\ & pclose\_execvp() & \ & \cxreffunc{pclose_execvp}{cxref.c}\\
\ & popen\_execvp() & \ & \cxreffunc{popen_execvp}{cxref.c}\\
\end{cxreftabiii}


\subsection{Functions}


\subsubsection{Global Function CanonicaliseName()}
\label{func_CanonicaliseName_cxref.c}

  Canonicalise a file name by removing '/../', '/./' and '//' references.

\smallskip
{\stt char* CanonicaliseName ( char* name )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{char* CanonicaliseName} Returns the argument modified.
\cxrefargitem{char* name} The original name
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Prototype:& cxref.h & \ & \cxreffile{cxref.h}\\
Calls:\ & \cxreftabiiispan{ strcmp(), strlen(), strstr()} &\\
Called by:\ & SeenFileChange() & preproc.c & \cxreffunc{SeenFileChange}{preproc.c}\\
\ & SeenInclude() & preproc.c & \cxreffunc{SeenInclude}{preproc.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\end{cxreftabiii}


\subsubsection{Global Function main()}
\label{func_main_cxref.c}

  The main function that calls the parser.

\smallskip
{\stt int main ( int argc, char** argv )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int main} Returns the status, zero for normal termination, else an error.
\cxrefargitem{int argc} The command line number of arguments.
\cxrefargitem{char** argv} The actual command line arguments
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Calls:\ & CanonicaliseName() & cxref.c & \cxreffunc{CanonicaliseName}{cxref.c}\\
\ & ConcatStrings() & memory.c & \cxreffunc{ConcatStrings}{memory.c}\\
\ & CreateAppendix() & xref.c & \cxreffunc{CreateAppendix}{xref.c}\\
\ & CrossReference() & xref.c & \cxreffunc{CrossReference}{xref.c}\\
\cxreftabbreak{cxreftabiii}
\ & CrossReferenceDelete() & xref.c & \cxreffunc{CrossReferenceDelete}{xref.c}\\
\ & DeleteComment() & comment.c & \cxreffunc{DeleteComment}{comment.c}\\
\ & DeleteFile() & file.c & \cxreffunc{DeleteFile}{file.c}\\
\ & DeleteStringList() & slist.c & \cxreffunc{DeleteStringList}{slist.c}\\
\ & DeleteStringList2() & slist.c & \cxreffunc{DeleteStringList2}{slist.c}\\
\ & DocumentTheFile() & cxref.c & \cxreffunc{DocumentTheFile}{cxref.c}\\
\ & NewFile() & file.c & \cxreffunc{NewFile}{file.c}\\
\ & NewStringList() & slist.c & \cxreffunc{NewStringList}{slist.c}\\
\cxreftabbreak{cxreftabiii}
\ & NewStringList2() & slist.c & \cxreffunc{NewStringList2}{slist.c}\\
\ & ParseConfigFile() & cxref.c & \cxreffunc{ParseConfigFile}{cxref.c}\\
\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & PrintMemoryStatistics() & memory.c & \cxreffunc{PrintMemoryStatistics}{memory.c}\\
\ & ResetFunctionAnalyser() & func.c & \cxreffunc{ResetFunctionAnalyser}{func.c}\\
\ & ResetLexer() & parse-lex.c & \cxreffunc{ResetLexer}{parse-lex.c}\\
\ & ResetParser() & parse-yacc.c & \cxreffunc{ResetParser}{parse-yacc.c}\\
\ & ResetPreProcAnalyser() & preproc.c & \cxreffunc{ResetPreProcAnalyser}{preproc.c}\\
\cxreftabbreak{cxreftabiii}
\ & ResetTypeAnalyser() & type.c & \cxreffunc{ResetTypeAnalyser}{type.c}\\
\ & ResetVariableAnalyser() & var.c & \cxreffunc{ResetVariableAnalyser}{var.c}\\
\ & SafeFree() & memory.c & \cxreffunc{SafeFree}{memory.c}\\
\ & SafeMalloc() & memory.c & \cxreffunc{SafeMalloc}{memory.c}\\
\ & SafeMallocString() & memory.c & \cxreffunc{SafeMallocString}{memory.c}\\
\ & SafeRealloc() & memory.c & \cxreffunc{SafeRealloc}{memory.c}\\
\ & TidyMemory() & memory.c & \cxreffunc{TidyMemory}{memory.c}\\
\ & Usage() & cxref.c & \cxreffunc{Usage}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteHTMLAppendix() & html.c & \cxreffunc{WriteHTMLAppendix}{html.c}\\
\ & WriteHTMLFile() & html.c & \cxreffunc{WriteHTMLFile}{html.c}\\
\ & WriteHTMLFileDelete() & html.c & \cxreffunc{WriteHTMLFileDelete}{html.c}\\
\ & WriteLatexAppendix() & latex.c & \cxreffunc{WriteLatexAppendix}{latex.c}\\
\ & WriteLatexFile() & latex.c & \cxreffunc{WriteLatexFile}{latex.c}\\
\ & WriteLatexFileDelete() & latex.c & \cxreffunc{WriteLatexFileDelete}{latex.c}\\
\ & WriteRTFAppendix() & rtf.c & \cxreffunc{WriteRTFAppendix}{rtf.c}\\
\ & WriteRTFFile() & rtf.c & \cxreffunc{WriteRTFFile}{rtf.c}\\
\cxreftabbreak{cxreftabiii}
\ & WriteRTFFileDelete() & rtf.c & \cxreffunc{WriteRTFFileDelete}{rtf.c}\\
\ & WriteSGMLAppendix() & sgml.c & \cxreffunc{WriteSGMLAppendix}{sgml.c}\\
\ & WriteSGMLFile() & sgml.c & \cxreffunc{WriteSGMLFile}{sgml.c}\\
\ & WriteSGMLFileDelete() & sgml.c & \cxreffunc{WriteSGMLFileDelete}{sgml.c}\\
\ & WriteWarnRawAppendix() & warn-raw.c & \cxreffunc{WriteWarnRawAppendix}{warn-raw.c}\\
\ & WriteWarnRawFile() & warn-raw.c & \cxreffunc{WriteWarnRawFile}{warn-raw.c}\\
\ & \cxreftabiiispan{ chdir(), exit(), fprintf(), getcwd(), strcmp(), strlen(), strncmp()} &\\
Refs Var:\ & CurFile & cxref.c & \cxrefvar{CurFile}{cxref.c}\\
\ & cpp\_argument\_num & cxref.c & \cxrefvar{cpp_argument_num}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & cpp\_command & cxref.c & \cxrefvar{cpp_command}{cxref.c}\\
\ & cpp\_command\_num & cxref.c & \cxrefvar{cpp_command_num}{cxref.c}\\
\ & option\_delete & cxref.c & \cxrefvar{option_delete}{cxref.c}\\
\ & option\_files & cxref.c & \cxrefvar{option_files}{cxref.c}\\
\ & option\_html & cxref.c & \cxrefvar{option_html}{cxref.c}\\
\ & option\_incdirs & cxref.c & \cxrefvar{option_incdirs}{cxref.c}\\
\ & option\_index & cxref.c & \cxrefvar{option_index}{cxref.c}\\
\ & option\_latex & cxref.c & \cxrefvar{option_latex}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & option\_name & cxref.c & \cxrefvar{option_name}{cxref.c}\\
\ & option\_nfiles & cxref.c & \cxrefvar{option_nfiles}{cxref.c}\\
\ & option\_nincdirs & cxref.c & \cxrefvar{option_nincdirs}{cxref.c}\\
\ & option\_odir & cxref.c & \cxrefvar{option_odir}{cxref.c}\\
\ & option\_raw & cxref.c & \cxrefvar{option_raw}{cxref.c}\\
\ & option\_root & cxref.c & \cxrefvar{option_root}{cxref.c}\\
\ & option\_rtf & cxref.c & \cxrefvar{option_rtf}{cxref.c}\\
\ & option\_sgml & cxref.c & \cxrefvar{option_sgml}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & option\_warn & cxref.c & \cxrefvar{option_warn}{cxref.c}\\
\ & option\_xref & cxref.c & \cxrefvar{option_xref}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Local Function DocumentTheFile()}
\label{func_DocumentTheFile_cxref.c}

  Calls CPP for the file to get all of the needed information.

\smallskip
{\stt static int DocumentTheFile ( char* name )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int DocumentTheFile} Returns 1 in case of error, else 0.
\cxrefargitem{char* name} The name of the file to document.
\end{cxrefarglist}

\smallskip
  The CPP is started as a sub-process, (using popen to return a FILE* for lex to use).

\smallskip
\begin{cxreftabiii}
Prototype:& cxref.c & \ & \cxreffile{cxref.c}\\
Calls:\ & pclose\_execvp() & cxref.c & \cxreffunc{pclose_execvp}{cxref.c}\\
\ & popen\_execvp() & cxref.c & \cxreffunc{popen_execvp}{cxref.c}\\
\ & yyparse() & parse-yacc.c & \cxreffunc{yyparse}{parse-yacc.c}\\
\cxreftabbreak{cxreftabiii}
\ & yyrestart() & parse-lex.c & \cxreffunc{yyrestart}{parse-lex.c}\\
\ & \cxreftabiiispan{ exit(), fprintf(), stat()} &\\
Called by:\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
Refs Var:\ & cpp\_command & cxref.c & \cxrefvar{cpp_command}{cxref.c}\\
\ & cpp\_command\_num & cxref.c & \cxrefvar{cpp_command_num}{cxref.c}\\
\ & yyin & parse-lex.c & \cxrefvar{yyin}{parse-lex.c}\\
\end{cxreftabiii}


\subsubsection{Local Function ParseConfigFile()}
\label{func_ParseConfigFile_cxref.c}

  Read in the options from the configuration file.

\smallskip
{\stt static int ParseConfigFile ( void )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int ParseConfigFile} Returns the values returned by ParseOptions().
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Prototype:& cxref.c & \ & \cxreffile{cxref.c}\\
Calls:\ & CopyString() & memory.c & \cxreffunc{CopyString}{memory.c}\\
\ & ParseOptions() & cxref.c & \cxreffunc{ParseOptions}{cxref.c}\\
\ & SafeFree() & memory.c & \cxreffunc{SafeFree}{memory.c}\\
\cxreftabbreak{cxreftabiii}
\ & SafeMalloc() & memory.c & \cxreffunc{SafeMalloc}{memory.c}\\
\ & SafeRealloc() & memory.c & \cxreffunc{SafeRealloc}{memory.c}\\
\ & \cxreftabiiispan{ fclose(), fgets(), fopen(), fprintf(), strlen(), strncmp()} &\\
Called by:\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
Refs Var:\ & option\_files & cxref.c & \cxrefvar{option_files}{cxref.c}\\
\ & option\_nfiles & cxref.c & \cxrefvar{option_nfiles}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Local Function ParseOptions()}
\label{func_ParseOptions_cxref.c}

  Parse the options from the command line or from the .cxref file.

\smallskip
{\stt static int ParseOptions ( int nargs, char** args, int fromfile )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int ParseOptions} Return 1 if there is an error.
\cxrefargitem{int nargs} The number of arguments.
\cxrefargitem{char** args} The actual arguments
\cxrefargitem{int fromfile} A flag indicating that they are read from the .cxref file.
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Prototype:& cxref.c & \ & \cxreffile{cxref.c}\\
Calls:\ & SafeFree() & memory.c & \cxreffunc{SafeFree}{memory.c}\\
\ & SafeMalloc() & memory.c & \cxreffunc{SafeMalloc}{memory.c}\\
\ & SafeMallocString() & memory.c & \cxreffunc{SafeMallocString}{memory.c}\\
\cxreftabbreak{cxreftabiii}
\ & SafeRealloc() & memory.c & \cxreffunc{SafeRealloc}{memory.c}\\
\ & \cxreftabiiispan{ fprintf(), strcmp(), strncmp()} &\\
Called by:\ & ParseConfigFile() & cxref.c & \cxreffunc{ParseConfigFile}{cxref.c}\\
\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
Refs Var:\ & cpp\_argument\_num & cxref.c & \cxrefvar{cpp_argument_num}{cxref.c}\\
\ & cpp\_command & cxref.c & \cxrefvar{cpp_command}{cxref.c}\\
\ & cpp\_command\_num & cxref.c & \cxrefvar{cpp_command_num}{cxref.c}\\
\ & option\_all\_comments & cxref.c & \cxrefvar{option_all_comments}{cxref.c}\\
\ & option\_block\_comments & cxref.c & \cxrefvar{option_block_comments}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & option\_delete & cxref.c & \cxrefvar{option_delete}{cxref.c}\\
\ & option\_files & cxref.c & \cxrefvar{option_files}{cxref.c}\\
\ & option\_html & cxref.c & \cxrefvar{option_html}{cxref.c}\\
\ & option\_incdirs & cxref.c & \cxrefvar{option_incdirs}{cxref.c}\\
\ & option\_index & cxref.c & \cxrefvar{option_index}{cxref.c}\\
\ & option\_latex & cxref.c & \cxrefvar{option_latex}{cxref.c}\\
\ & option\_name & cxref.c & \cxrefvar{option_name}{cxref.c}\\
\ & option\_nfiles & cxref.c & \cxrefvar{option_nfiles}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & option\_nincdirs & cxref.c & \cxrefvar{option_nincdirs}{cxref.c}\\
\ & option\_no\_comments & cxref.c & \cxrefvar{option_no_comments}{cxref.c}\\
\ & option\_odir & cxref.c & \cxrefvar{option_odir}{cxref.c}\\
\ & option\_raw & cxref.c & \cxrefvar{option_raw}{cxref.c}\\
\ & option\_root & cxref.c & \cxrefvar{option_root}{cxref.c}\\
\ & option\_rtf & cxref.c & \cxrefvar{option_rtf}{cxref.c}\\
\ & option\_sgml & cxref.c & \cxrefvar{option_sgml}{cxref.c}\\
\ & option\_verbatim\_comments & cxref.c & \cxrefvar{option_verbatim_comments}{cxref.c}\\
\cxreftabbreak{cxreftabiii}
\ & option\_warn & cxref.c & \cxrefvar{option_warn}{cxref.c}\\
\ & option\_xref & cxref.c & \cxrefvar{option_xref}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Local Function Usage()}
\label{func_Usage_cxref.c}

  Print out the usage instructions.

\smallskip
{\stt static void Usage ( int verbose )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int verbose} If true then output a long version of the information.
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Prototype:& cxref.c & \ & \cxreffile{cxref.c}\\
Calls:\ & \cxreftabiiispan{ exit(), fputs()} &\\
Called by:\ & main() & cxref.c & \cxreffunc{main}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Local Function pclose\_execvp()}
\label{func_pclose_execvp_cxref.c}

  Close the file to the to the preprocessor

\smallskip
{\stt static int pclose\_execvp ( FILE* f )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{int pclose\_execvp} Return the error status.
\cxrefargitem{FILE* f} The file to close.
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Prototype:& cxref.c & \ & \cxreffile{cxref.c}\\
Calls:\ & \cxreftabiiispan{ fclose(), waitpid()} &\\
Called by:\ & DocumentTheFile() & cxref.c & \cxreffunc{DocumentTheFile}{cxref.c}\\
Refs Var:\ & popen\_pid & cxref.c & \cxrefvar{popen_pid}{cxref.c}\\
\end{cxreftabiii}


\subsubsection{Local Function popen\_execvp()}
\label{func_popen_execvp_cxref.c}

  A popen function that takes a list of arguments not a string.

\smallskip
{\stt static FILE* popen\_execvp ( char** command )}

\smallskip
\begin{cxrefarglist}
\cxrefargitem{FILE* popen\_execvp} Returns a file descriptor.
\cxrefargitem{char** command} The command arguments.
\end{cxrefarglist}

\smallskip
\begin{cxreftabiii}
Prototype:& cxref.c & \ & \cxreffile{cxref.c}\\
Calls:\ & \cxreftabiiispan{ close(), dup(), execvp(), exit(), fdopen(), fork(), fprintf(), pipe()} &\\
Called by:\ & DocumentTheFile() & cxref.c & \cxreffunc{DocumentTheFile}{cxref.c}\\
Refs Var:\ & popen\_pid & cxref.c & \cxrefvar{popen_pid}{cxref.c}\\
\end{cxreftabiii}

