1% Style file for Roaring Penguin software maintenance documents
2% Please use these macros in your LaTeX documentation:
3% \tclok             -- expands to TCL_OK in fixed-width font
4% \tclerr            -- expands to TCL_ERROR in fixed-width font
5% \squiggle          -- Outputs "~" (tilde)
6% \type{foo}         -- Use for C++ types.  e.g.:  \type{unsigned char}
7% \param{bar}        -- Use for function parameters
8% \incfile{foo/b.h}  -- Use for C++ header files
9% \name{func}        -- Use for function and method names.
10\newcommand{\tclok}{\texttt{TCL\_OK}}
11\newcommand{\tclerr}{\texttt{TCL\_ERROR}}
12\newcommand{\squiggle}{\symbol{"7E}}% \tilde was already taken...
13\newcommand{\type}[1]{\textit{#1}}
14\newcommand{\param}[1]{\texttt{#1}}
15\newcommand{\incfile}[1]{\texttt{#1}}
16\newcommand{\name}[1]{\textbf{#1}}
17
18% \function{type}{name}{(arglist)}{description}{returns}
19%
20% Example:
21% \function{int}{abs}{(\type{int} \param{j})}
22% {Computes the absolute value of \param{j}.}    % Description
23% {The absolute value of \param{j}.}             % Returns
24% \begin{itemize}                                % Arguments
25% \item \param{j} -- The number whose absolute value is needed
26% \end{itemize}
27%
28% Note that ``arglist'' is typeset in a tabbing environment; you
29% can do this to align arguments:
30% \function{int}{frob}{(\=\type{int} \param{arg1},\\
31% \>\type{char *} \param{arg2}, \\
32% \>\type{double} \param{arg3})} ...
33
34\newcommand{\function}[5]{%
35  \begin{tabbing}{\rule{\linewidth}{0.5pt}}\\%
36    \type{#1} \name{#2}#3\end{tabbing}%
37  \begin{description}%
38  \item[Description:] {#4}%
39  \item[Returns:] {#5}%
40  \item[Arguments:]%
41  \end{description}%
42}
43% \method{type}{class}{name}{(arglist)}{description}{returns}
44%
45% Example:
46% \method{void}{Box}{engulf}{(\type{Point} \param{p})}
47% {Enlarges \param{self} to include \param{p}}   % Description
48% {Nothing.}                                     % Returns
49% \begin{itemize}                                % Arguments
50% \item \param{p} -- A point to be included in the box.
51% \end{itemize}
52%
53% Note that ``arglist'' is typeset in a tabbing environment as with
54% \function
55
56\newcommand{\method}[6]{%
57  \begin{tabbing}\rule{\linewidth}{0.5pt}\\%
58  \type{#1} \name{#2}::\name{#3}#4\end{tabbing}%
59  \begin{description}%
60  \item[Description:] {#5}%
61  \item[Returns:] {#6}%
62  \item[Arguments:] %
63  \end{description}%
64}
65
66% \simplemethod{type}{class}{name}{(arglist)}{description}
67%
68% Simpler version when \method is overkill.  Just includes description.
69% Example:
70% \simplemethod{void}{Box}{engulf}{(\type{Point} \param{p})}
71% {Enlarges \param{self} to include \param{p}}   % Description
72% Note that ``arglist'' is typeset in a tabbing environment as with
73% \function
74
75\newcommand{\simplemethod}[5]{%
76  \begin{tabbing}\rule{\linewidth}{0.5pt}\\%
77  \type{#1} \name{#2}::\name{#3}#4\end{tabbing}%
78  \begin{description}%
79  \item[Description:] {#5}%
80  \end{description}%
81}
82
83% \simplefunction{type}{name}{(arglist)}{description}
84%
85% Simpler version when \function is overkill.  Just includes description.
86% Example:
87% \simplefunction{void}{Box}{engulf}{(\type{Point} \param{p})}
88% {Enlarges \param{self} to include \param{p}}   % Description
89% Note that ``arglist'' is typeset in a tabbing environment as with
90% \function
91
92\newcommand{\simplefunction}[4]{%
93  \begin{tabbing}\rule{\linewidth}{0.5pt}\\%
94  \type{#1} \name{#2}#3\end{tabbing}%
95  \begin{description}%
96  \item[Description:] {#4}%
97  \end{description}%
98}
99
100% \tclmethod -- like \method, but for Tcl methods.
101\newcommand{\tclmethod}[6]{%
102  \begin{tabbing}\rule{\linewidth}{0.5pt}\\%
103  \type{#1} \name{#2}.\name{#3} #4\end{tabbing}%
104  \begin{description}%
105  \item[Description:] {#5}%
106  \item[Returns:] {#6}%
107  \item[Arguments:]
108  \end{description}%
109}
110% \variable{type}{name}{description}
111% Use this for global variables.
112%
113% Example:
114% \variable{int}{Timeout}
115% {The timeout value of frobnosticate in seconds.}
116
117\newcommand{\variable}[3]{\rule{\linewidth}{0.5pt}\\%
118  \type{#1} \name{#2}%
119  \begin{description}%
120  \item[Description:] {#3}%
121  \end{description}%
122}
123
124\newcommand{\synopsis}[3]{\rule{\linewidth}{0.5pt}%
125\\%
126\begin{tabular}{l@@{ }l@@{}p{4in}}
127\name{#1} & \texttt{#2} & \texttt{#3}%
128\end{tabular}
129\\%
130\raisebox{5pt}{\rule{\linewidth}{0.5pt}}}
131
132\setlength{\parindent}{0pt}
133\setlength{\parskip}{2pt}
134
135\ifx\pdfoutput\undefined
136\newcommand{\eps}{eps}
137\else
138\newcommand{\eps}{pdf}
139\fi
140