aboutsummaryrefslogtreecommitdiff
path: root/doc/implement/functions.sty
blob: dcccfb542a146ac18d63ab5511891fc09de4a817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
%
% definitions related to function declarations/displays
%
\ifx\undefined\@psfonts
\def\argfont{\tt}
\else
\font\argfont = c-bol
\hyphenchar\argfont = -1
\fi
\let\funcfont=\bf
\newcount\argc@ount
%
% funcdecl is used as \begin{funcdecl}{funcname}{return type}{firstline}
%
% see fixunder.sty for comments on why the \underrealtrue & \underrealfalse
% stuff is here.
\newenvironment{funcdecl}[3]{\underrealtrue\index{#1}\underrealfalse%
\argc@ount=0\begin{tabbing}
#2 \\
{\bf #1}(\= \+ #3%
}{)
\end{tabbing}
}
\newcommand{\docomm@}{\ifnum\argc@ount >0, \\\fi}
\newcommand{\funcvoid}{\argc@ount=0}
\newcommand{\funcin}{\docomm@\argc@ount=0{\sl /* IN */}\\}
\newcommand{\funcinout}{\docomm@\argc@ount=0{\sl /* INOUT */}\\}
\newcommand{\funcout}{\docomm@\argc@ount=0{\sl /* OUT */}\\}
\newcommand{\funcarg}[2]{\docomm@#1 {\argfont #2}\advance\argc@ount by1}
\newcommand{\funcparam}[1]{{\argfont #1}}
\newcommand{\funcfuncarg}[2]{\docomm@#1 {\argfont #2}(\= \+ \argc@ount=0}
\newcommand{\funcendfuncarg}{), \- \\ \argc@ount=0}
\newcommand{\libname}[1]{{\argfont #1}}
\newcommand{\globalname}[1]{{\argfont #1}}
\newcommand{\ptsto}{->\discretionary{}{}{}}
\newcommand{\datatype}[1]{{\bf #1}}
\newcommand{\filename}[1]{{\sl #1\/}}

\newcommand{\funcname}[1]{\underrealtrue\index{#1}\underrealfalse{\funcfont #1}()}
\newcommand{\funcnamenoparens}[1]{\underrealtrue\index{#1}\underrealfalse{\funcfont #1}}