2 % definitions related to function declarations/displays
4 \ifx\undefined\@psfonts
8 \hyphenchar\argfont = -1
12 %\setlength{\marginparsep}{0.05in}
13 %\setlength{\marginparwidth}{1.45in}
15 % This function fixes up the function name to be displayed in the
16 % margin so that the krb5_, if any, is stripped.
18 % Note: this is a hack; what's really happening is that name beginning with
19 % krb5 will have its first five characters stripped from it.
20 % This means that 'Krb5abc' will get rewritten to be 'bc'.
21 % Unfortunately, we can't do better because of the underscore
22 % hacks that are going on elsewhere.
24 % WARNING: This is ugly; don't look at it too soon after lunch!
25 % [tytso:19900920.2231EDT]
28 \def\fix@parname#1{\expandafter\parse@krb#1\endkrb%
29 \endkrb\endkrb\endkrb\endkrb}% In case the argument is less
30 % than five letters, we don't want to
31 % lose on the argument parsing.
32 \def\parse@krb#1#2#3#4#5#6\endkrb{\@krbfuncfalse%
33 \if#1k\if#2r\if#3b\if#45\@krbfunctrue\fi\fi\fi\fi%
34 \if@krbfunc#6\else#1#2#3#4#5#6\fi}
36 % funcdecl is used as \begin{funcdecl}{funcname}{return type}{firstline}
38 % see fixunder.sty for comments on why the \underrealtrue & \underrealfalse
40 \newenvironment{funcdecl}[3]{\underrealtrue\index{#1}\underrealfalse%
43 \argc@ount=0\noindent%
44 %the \mbox{} is to prevent the line/paragraph breaking from eating the
46 \marginpar[{{\sloppy \hfil\fix@parname{\funcn@me}\hfill\mbox{}}}]%
47 {{\sloppy \hfill\fix@parname{\funcn@me}\hfil\mbox{}}}%
48 \vbox\bgroup\begin{minipage}[t]{\textwidth}\begin{tabbing}
52 \end{tabbing}\vfil\end{minipage}\egroup\par\nopagebreak
54 \newcommand{\docomm@}{\ifnum\argc@ount >0, \\\fi}
55 \newcommand{\funcvoid}{\argc@ount=0}
56 \newcommand{\funcin}{\docomm@\argc@ount=0{\sl /* IN */}\\}
57 \newcommand{\funcinout}{\docomm@\argc@ount=0{\sl /* IN/OUT */}\\}
58 \newcommand{\funcout}{\docomm@\argc@ount=0{\sl /* OUT */}\\}
59 \newcommand{\funcarg}[2]{\docomm@#1 {\argfont #2}\advance\argc@ount by1}
60 \newcommand{\funcparam}[1]{{\argfont #1}}
61 \newcommand{\funcfuncarg}[2]{\docomm@#1 {\argfont #2}(\= \+ \argc@ount=0}
62 \newcommand{\funcendfuncarg}{), \- \\ \argc@ount=0}
63 \newcommand{\libname}[1]{{\argfont #1}}
64 \newcommand{\globalname}[1]{{\argfont #1}}
65 \newcommand{\ptsto}{->\discretionary{}{}{}}
66 \newcommand{\datatype}[1]{{\bf #1}}
67 \newcommand{\filename}[1]{{\sl #1\/}}
69 \newcommand{\funcname}[1]{\underrealtrue\index{#1}\underrealfalse{\funcfont #1}()}
70 \newcommand{\funcnamenoparens}[1]{\underrealtrue\index{#1}\underrealfalse{\funcfont #1}}