2 % Defining some commands to manipulate counter to avoid ude of
3 % \label and \ref commands (and related problem to remeber the
4 % used labels) to refer nearest objects
7 \newcounter{usercount} % define a new counter for internal use
11 \newcommand{\figref}[1]{fig.~\ref{#1}}
15 \newcommand{\tabref}[1]{tab.~\ref{#1}}
19 \newcommand{\cureq}{(\theequation)}
21 \setcounter{usercount}{\value{equation}}%
22 \addtocounter{usercount}{1}%
23 (\thechapter.\theusercount)}
25 \setcounter{usercount}{\value{equation}}%
26 \addtocounter{usercount}{-1}%
27 (\thechapter.\theusercount)}
29 % Macro to put picture (in format PICT) inside a figure
31 \newcommand{\pictfig}[3]{
32 \begin{minipage}[t][#1][b]{#2}
33 \mbox{\special{pict=#3}}
38 % Command for section and chapters
40 \newcommand{\capref}[1]{cap.~\ref{#1}}
41 \newcommand{\secref}[1]{sez.~\ref{#1}}
43 % Macro to create a special environment for function prototypes
46 \newenvironment{prototype}[2]
47 {% defining what is done by \begin
49 \begin{boxedminipage}[c]{14cm}
51 \begin{description*}{}{}
52 \item \texttt{\#include <#1>}
53 \item \texttt{#2} \par
54 % \begin{lstlisting}{}
59 {% defining what is done by \end
68 \newenvironment{errlist}{\begin{basedescript}{\desclabelwidth{1.5cm}}}
71 % Slighty different envirnoment to be used for multi-header,
72 % multi-functions boxed description
74 \newcommand{\headdecl}[1]{\item\texttt{\#include <#1>}}
75 \newcommand{\funcdecl}[1]{\item\texttt{#1}\par}
76 \newcommand{\bodydesc}[1]{\par \end{description*} #1
77 \begin{description*}{}{} \baselineskip=0pt
81 \newenvironment{functions}
82 {% defining what is done by \begin
84 \begin{boxedminipage}[c]{14cm}
86 \begin{description*}{}{}
88 {% defining what is done by \end
97 % Wrapper for shell command, functions, filenames, links,
98 % variables, macros, and everything can be useul,
100 \newcommand{\cmd}[1]{\texttt{#1}} % shell command
101 \newcommand{\code}[1]{\texttt{#1}} % for simple code
102 \newcommand{\func}[1]{%
103 \index{#1@{\tt {#1}}}\texttt{#1}%
104 } % library function (or system call)
105 \newcommand{\macro}[1]{\texttt{#1}} % macro constant
106 \newcommand{\var}[1]{\texttt{#1}} % variable
107 \newcommand{\file}[1]{\texttt{#1}} % file name
108 \newcommand{\link}[1]{\texttt{#1}} % html link
109 \newcommand{\ctyp}[1]{\texttt{#1}} % C standard type
110 \newcommand{\type}[1]{%
111 \index{#1@{\tt {#1}}}\texttt{#1}%
113 \newcommand{\param}[1]{\texttt{#1}} % function parameter
114 \newcommand{\acr}[1]{\textsl{#1}} % acrostic (for pid, suid, etc.)
119 %%% TeX-master: "gapil"