3 %% Copyright (C) 2000-2005 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 "Un preambolo",
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{\cureq}{(\theequation)}
23 \setcounter{usercount}{\value{equation}}%
24 \addtocounter{usercount}{1}%
25 (\thechapter.\theusercount)}
27 \setcounter{usercount}{\value{equation}}%
28 \addtocounter{usercount}{-1}%
29 (\thechapter.\theusercount)}
31 % Macro to put picture (in format PICT) inside a figure
33 \newcommand{\pictfig}[3]{
34 \begin{minipage}[t][#1][b]{#2}
35 \mbox{\special{pict=#3}}
40 % Macro to create a special environment for function prototypes
43 \newenvironment{prototype}[2]
44 {% defining what is done by \begin
47 \begin{boxedminipage}[c]{14cm}
49 \begin{description*}{}{}
50 \item \texttt{\#include <#1>}
51 \item \texttt{#2} \par
52 % \begin{lstlisting}{}
57 {% defining what is done by \end
66 \newenvironment{errlist}{\begin{basedescript}{\desclabelwidth{1.5cm}}}
69 % Slighty different envirnoment to be used for multi-header,
70 % multi-functions boxed description
72 \newcommand{\headdecl}[1]{\item\texttt{\#include <#1>}}
73 \newcommand{\funcdecl}[1]{\item\texttt{#1}\par}
74 \newcommand{\bodydesc}[1]{\par \end{description*} #1
75 \begin{description*}{}{} \baselineskip=0pt
79 \newenvironment{functions}
80 {% defining what is done by \begin
83 \begin{boxedminipage}[c]{14cm}
85 \begin{description*}{}{}
87 {% 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
103 \newcommand{\func}[1]{%
104 \index{funzione!{#1}@{{\tt {#1}}}}\texttt{#1}%
105 %\index{#1@{{\tt {#1}} (funzione)}}\texttt{#1}%
108 \newcommand{\funcd}[1]{%
109 \index{funzione!{#1}@{{\tt {#1}}}!definizione di}\texttt{#1}%
110 %\index{#1@{{\tt {#1}} (funzione)}!definizione di}\texttt{#1}%
113 \newcommand{\macro}[1]{%
114 \index{macro!{#1}@{{\tt {#1}}}}\texttt{#1}%
115 %\index{#1@{{\tt {#1}} (macro)}}\texttt{#1}%
118 \newcommand{\errcode}[1]{%
119 \index{errore!{#1}@{{\tt {#1}}}}\texttt{#1}%
120 %\index{#1@{{\tt {#1}} (errore)}}\texttt{#1}%
123 \newcommand{\errval}[1]{\texttt{#1}} % value
124 \newcommand{\var}[1]{\texttt{#1}} % variable
125 \newcommand{\val}[1]{\texttt{#1}} % value
127 \newcommand{\const}[1]{%
128 \index{costante!{#1}@{{\tt {#1}}}}\texttt{#1}%
129 %\index{#1@{{\tt {#1}} (costante)}}\texttt{#1}%
132 \newcommand{\direct}[1]{%
133 \index{direttiva!{#1}@{{\tt {#1}}}}\texttt{#1}%
134 %\index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
137 \newcommand{\file}[1]{\texttt{#1}} % file name
138 \newcommand{\link}[1]{\texttt{#1}} % html link
139 \newcommand{\ctyp}[1]{\texttt{#1}} % C standard type
141 \newcommand{\type}[1]{%
142 \index{tipo!{#1}@{{\tt {#1}}}}\texttt{#1}%
143 %\index{#1@{{\tt {#1}} (tipo)}}\texttt{#1}%
145 \newcommand{\struct}[1]{%
146 \index{struttura dati!{#1}@{{\tt {#1}}}}\texttt{#1}%
147 %\index{#1@{{\tt {#1}} (struttura dati)}}\texttt{#1}%
149 \newcommand{\structd}[1]{%
150 \index{struttura dati!{#1}@{{\tt {#1}}}!definizione di}\texttt{#1}%
151 %\index{#1@{{\tt {#1}} (struttura dati)}!definizione di}\texttt{#1}%
153 \newcommand{\param}[1]{\texttt{#1}} % function parameter
154 \newcommand{\acr}[1]{\textsl{#1}} % acrostic (for pid, suid, ecc.)
156 \newcommand{\itindex}[1]{%
157 \index{#1@{\textit{#1}}}%
160 \newcommand{\itindbeg}[1]{%
161 \index{#1@{\textit{#1}}|(}%
163 \newcommand{\itindend}[1]{%
164 \index{#1@{\textit{#1}}|)}%
166 \newcommand{\itindsub}[2]{%
167 \index{#1@{\textit{#1}}!\textit{#2}}%
170 % Aggiunte di Mirko per la gestione delle tabelle complicate come immagini
171 % nella traslazione in HTML
172 \newenvironment{usepicture}{}{}{}{}
176 %%% TeX-master: "gapil"