summaryrefslogtreecommitdiffstats
path: root/doc/api/functions.sty
blob: c30c730b29f52aeeea8178a0249f22ee16cf4b5e (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
41
42
43
44
%
% definitions related to function declarations/displays
%
\ifx\undefined\@psfonts
\def\argfont{\tt}
\else
\font\argfont = c-bol
\hyphenchar\argfont = -1
\fi
\newcount\argc@ount
% funcdecl is used as \begin{funcdecl}[funcname]{return type}{firstline}
\def\funcdecl{\makeunderletter\@moreindex}
%
% this isn't quite right; we need to have \@morefuncdecl{#1} get #1
% expanded and then re-scanned by TeX to reassign catcodes to _'s in it.
%
\def\@moreindex[#1]{\index{#1}\makeunderactive\@morefuncdecl{#1}}
\def\@morefuncdecl#1#2#3{\argc@ount=0\begin{tabbing}
#2 \\
{\bf #1}(\= \+ #3%\doindex%
}
\def\endfuncdecl{)
\end{tabbing}
}
\newcommand{\docomm@}{\ifnum\argc@ount >0, \\\fi}
\newcommand{\funcvoid}{}
\newcommand{\funcin}{\docomm@\argc@ount=0{\it /* IN */}\\}
\newcommand{\funcinout}{\docomm@\argc@ount=0{\it /* INOUT */}\\}
\newcommand{\funcout}{\docomm@\argc@ount=0{\it /* OUT */}\\}
\newcommand{\funcarg}[2]{\docomm@#1 {\argfont #2}\advance\argc@ount by1}
\newcommand{\funcparam}[1]{{\argfont #1}}
\newcommand{\funcname}[1]{{\bf #1}()}
\newcommand{\libname}[1]{{\argfont #1}}
\newcommand{\ptsto}{->\discretionary{}{}{}}
\newcommand{\datatype}[1]{{\bf #1}}