From 5246bbf6f89bf734110d1cec3af3119fe00258a0 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 27 Sep 1990 19:56:48 +0000 Subject: [PATCH] Fixed the marginpar-handing stuff to put function names into the margin. Names begining with krb5_ now have that prefix stripped before it's put into the margin. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1149 dc483132-0cff-0310-8789-dd5450dbe970 --- doc/api/functions.sty | 33 ++++++++++++++++++++++++++++----- doc/implement/functions.sty | 33 ++++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/doc/api/functions.sty b/doc/api/functions.sty index 3d04f34a7..17982fdf5 100644 --- a/doc/api/functions.sty +++ b/doc/api/functions.sty @@ -9,21 +9,44 @@ \fi \let\funcfont=\bf \newcount\argc@ount -\reversemarginpar -\setlength{\marginparsep}{3pt} -%\setlength{\marginparwidth}{1in} +%\setlength{\marginparsep}{0.05in} +%\setlength{\marginparwidth}{1.45in} +% +% This function fixes up the function name to be displayed in the +% margin so that the krb5_, if any, is stripped. +% +% Note: this is a hack; what's really happening is that name beginning with +% krb5 will have its first five characters stripped from it. +% This means that 'Krb5abc' will get rewritten to be 'bc'. +% Unfortunately, we can't do better because of the underscore +% hacks that are going on elsewhere. +% +% WARNING: This is ugly; don't look at it too soon after lunch! +% [tytso:19900920.2231EDT] +\newif\if@krbfunc +\def\endkrb{} +\def\fix@parname#1{\expandafter\parse@krb#1\endkrb% +\endkrb\endkrb\endkrb\endkrb}% In case the argument is less +% than five letters, we don't want to +% lose on the argument parsing. +\def\parse@krb#1#2#3#4#5#6\endkrb{\@krbfuncfalse% +\if#1k\if#2r\if#3b\if#45\@krbfunctrue\fi\fi\fi\fi% +\if@krbfunc#6\else#1#2#3#4#5#6\fi} % % 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% +\medbreak \gdef\funcn@me{#1} -\argc@ount=0\begin{tabbing} +\argc@ount=0\noindent\marginpar[{{\sloppy \fix@parname{\funcn@me}}}]% +{{\sloppy \hfill\fix@parname{\funcn@me}}}% +\vbox\bgroup\begin{minipage}[t]{\textwidth}\begin{tabbing} #2 \\ {\bf #1}(\= \+ #3% }{) -\end{tabbing}\marginpar{{\sloppy \funcn@me}} +\end{tabbing}\vfil\end{minipage}\egroup\par\nopagebreak } \newcommand{\docomm@}{\ifnum\argc@ount >0, \\\fi} \newcommand{\funcvoid}{\argc@ount=0} diff --git a/doc/implement/functions.sty b/doc/implement/functions.sty index 3d04f34a7..17982fdf5 100644 --- a/doc/implement/functions.sty +++ b/doc/implement/functions.sty @@ -9,21 +9,44 @@ \fi \let\funcfont=\bf \newcount\argc@ount -\reversemarginpar -\setlength{\marginparsep}{3pt} -%\setlength{\marginparwidth}{1in} +%\setlength{\marginparsep}{0.05in} +%\setlength{\marginparwidth}{1.45in} +% +% This function fixes up the function name to be displayed in the +% margin so that the krb5_, if any, is stripped. +% +% Note: this is a hack; what's really happening is that name beginning with +% krb5 will have its first five characters stripped from it. +% This means that 'Krb5abc' will get rewritten to be 'bc'. +% Unfortunately, we can't do better because of the underscore +% hacks that are going on elsewhere. +% +% WARNING: This is ugly; don't look at it too soon after lunch! +% [tytso:19900920.2231EDT] +\newif\if@krbfunc +\def\endkrb{} +\def\fix@parname#1{\expandafter\parse@krb#1\endkrb% +\endkrb\endkrb\endkrb\endkrb}% In case the argument is less +% than five letters, we don't want to +% lose on the argument parsing. +\def\parse@krb#1#2#3#4#5#6\endkrb{\@krbfuncfalse% +\if#1k\if#2r\if#3b\if#45\@krbfunctrue\fi\fi\fi\fi% +\if@krbfunc#6\else#1#2#3#4#5#6\fi} % % 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% +\medbreak \gdef\funcn@me{#1} -\argc@ount=0\begin{tabbing} +\argc@ount=0\noindent\marginpar[{{\sloppy \fix@parname{\funcn@me}}}]% +{{\sloppy \hfill\fix@parname{\funcn@me}}}% +\vbox\bgroup\begin{minipage}[t]{\textwidth}\begin{tabbing} #2 \\ {\bf #1}(\= \+ #3% }{) -\end{tabbing}\marginpar{{\sloppy \funcn@me}} +\end{tabbing}\vfil\end{minipage}\egroup\par\nopagebreak } \newcommand{\docomm@}{\ifnum\argc@ount >0, \\\fi} \newcommand{\funcvoid}{\argc@ount=0} -- 2.26.2