3 %% Copyright (C) 2000-2002 Simone Piccardi. Permission is granted to
4 %% copy, distribute and/or modify this document under the terms of the GNU Free
5 %% Documentation License, Version 1.1 or any later version published by the
6 %% Free Software Foundation; with the Invariant Sections being "Prefazione",
7 %% with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the
8 %% license is included in the section entitled "GNU Free Documentation
12 % Defining some commands to manipulate counter to avoid ude of
13 % \label and \ref commands (and related problem to remeber the
14 % used labels) to refer nearest objects
17 \newcounter{usercount} % define a new counter for internal use
21 \newcommand{\figref}[1]{fig.~\ref{#1}}
25 \newcommand{\tabref}[1]{tab.~\ref{#1}}
29 \newcommand{\cureq}{(\theequation)}
31 \setcounter{usercount}{\value{equation}}%
32 \addtocounter{usercount}{1}%
33 (\thechapter.\theusercount)}
35 \setcounter{usercount}{\value{equation}}%
36 \addtocounter{usercount}{-1}%
37 (\thechapter.\theusercount)}
39 % Macro to put picture (in format PICT) inside a figure
41 \newcommand{\pictfig}[3]{
42 \begin{minipage}[t][#1][b]{#2}
43 \mbox{\special{pict=#3}}
48 % Command for section and chapters
50 \newcommand{\capref}[1]{cap.~\ref{#1}}
51 \newcommand{\secref}[1]{sez.~\ref{#1}}
53 % Macro to create a special environment for function prototypes
56 \newenvironment{prototype}[2]
57 {% defining what is done by \begin
59 \begin{boxedminipage}[c]{14cm}
61 \begin{description*}{}{}
62 \item \texttt{\#include <#1>}
63 \item \texttt{#2} \par
64 % \begin{lstlisting}{}
69 {% defining what is done by \end
78 \newenvironment{errlist}{\begin{basedescript}{\desclabelwidth{1.5cm}}}
81 % Slighty different envirnoment to be used for multi-header,
82 % multi-functions boxed description
84 \newcommand{\headdecl}[1]{\item\texttt{\#include <#1>}}
85 \newcommand{\funcdecl}[1]{\item\texttt{#1}\par}
86 \newcommand{\bodydesc}[1]{\par \end{description*} #1
87 \begin{description*}{}{} \baselineskip=0pt
91 \newenvironment{functions}
92 {% defining what is done by \begin
94 \begin{boxedminipage}[c]{14cm}
96 \begin{description*}{}{}
98 {% defining what is done by \end
107 % Wrapper for shell command, functions, filenames, links,
108 % variables, macros, and everything can be useul,
110 \newcommand{\cmd}[1]{\texttt{#1}} % shell command
111 \newcommand{\code}[1]{\texttt{#1}} % for simple code
112 \newcommand{\func}[1]{%
113 \index{#1@{{\tt {#1}} (funzione)}}\texttt{#1}%
115 \newcommand{\macro}[1]{%
116 \index{#1@{{\tt {#1}} (macro)}}\texttt{#1}
118 \newcommand{\errcode}[1]{%
119 \index{#1@{{\tt {#1}} (errore)}}\texttt{#1}%
121 \newcommand{\var}[1]{\texttt{#1}} % variable
122 \newcommand{\val}[1]{\texttt{#1}} % value
123 \newcommand{\const}[1]{
124 \index{#1@{{\tt {#1}} (costante)}}\texttt{#1}
126 \newcommand{\file}[1]{\texttt{#1}} % file name
127 \newcommand{\link}[1]{\texttt{#1}} % html link
128 \newcommand{\ctyp}[1]{\texttt{#1}} % C standard type
129 \newcommand{\type}[1]{%
130 \index{#1@{{\tt {#1}} (tipo)}}\texttt{#1}%
132 \newcommand{\param}[1]{\texttt{#1}} % function parameter
133 \newcommand{\acr}[1]{\textsl{#1}} % acrostic (for pid, suid, etc.)
138 %%% TeX-master: "gapil"