3 %% Copyright (C) 2000-2007 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
13 % Defining some special character for use inside typewriter
14 % text without using the verbatim environment
17 \def\bslash{\char'134}
18 \def\circonf{\char'136}
21 % Defining some commands to manipulate counter to avoid ude of
22 % \label and \ref commands (and related problem to remeber the
23 % used labels) to refer nearest objects
26 \newcounter{usercount} % define a new counter for internal use
30 \newcommand{\cureq}{(\theequation)}
32 \setcounter{usercount}{\value{equation}}%
33 \addtocounter{usercount}{1}%
34 (\thechapter.\theusercount)}
36 \setcounter{usercount}{\value{equation}}%
37 \addtocounter{usercount}{-1}%
38 (\thechapter.\theusercount)}
40 % Macro to put picture (in format PICT) inside a figure
42 \newcommand{\pictfig}[3]{
43 \begin{minipage}[t][#1][b]{#2}
44 \mbox{\special{pict=#3}}
49 % Macro to create a special environment for function prototypes
52 \newenvironment{prototype}[2]
53 {% defining what is done by \begin
56 \begin{boxedminipage}[c]{14cm}
58 \begin{description*}{}{}
59 \item \texttt{\#include <#1>}
60 \item \texttt{#2} \par
61 % \begin{lstlisting}{}
66 {% defining what is done by \end
75 \newenvironment{errlist}{\begin{basedescript}{\desclabelwidth{1.5cm}}}
78 % Slighty different envirnoment to be used for multi-header,
79 % multi-functions boxed description
81 \newcommand{\headdecl}[1]{\item\texttt{\#include <#1>}}
82 \newcommand{\funcdecl}[1]{\item\texttt{#1}\par}
83 \newcommand{\bodydesc}[1]{\par \end{description*} #1
84 \begin{description*}{}{} \baselineskip=0pt
88 \newenvironment{functions}
89 {% defining what is done by \begin
92 \begin{boxedminipage}[c]{14cm}
94 \begin{description*}{}{}
96 {% defining what is done by \end
106 % Wrapper for shell command, functions, filenames, links,
107 % variables, macros, and everything can be useul,
109 \newcommand{\cmd}[1]{\texttt{#1}} % shell command
110 \newcommand{\code}[1]{\texttt{#1}} % for simple code
112 \newcommand{\func}[1]{%
113 \index{funzione!{#1}@{{\tt {#1}}}}\texttt{#1}%
114 %\index{#1@{{\tt {#1}} (funzione)}}\texttt{#1}%
117 \newcommand{\funcd}[1]{%
118 \index{funzione!{#1}@{{\tt {#1}}}!definizione di}\texttt{#1}%
119 %\index{#1@{{\tt {#1}} (funzione)}!definizione di}\texttt{#1}%
122 \newcommand{\macro}[1]{%
123 \index{macro!{#1}@{{\tt {#1}}}}\texttt{#1}%
124 %\index{#1@{{\tt {#1}} (macro)}}\texttt{#1}%
127 \newcommand{\errcode}[1]{%
128 \index{errore!{#1}@{{\tt {#1}}}}\texttt{#1}%
129 %\index{#1@{{\tt {#1}} (errore)}}\texttt{#1}%
132 \newcommand{\errval}[1]{\texttt{#1}} % value
133 \newcommand{\var}[1]{\texttt{#1}} % variable
134 \newcommand{\val}[1]{\texttt{#1}} % value
136 \newcommand{\const}[1]{%
137 \index{costante!{#1}@{{\tt {#1}}}}\texttt{#1}%
138 %\index{#1@{{\tt {#1}} (costante)}}\texttt{#1}%
141 \newcommand{\direct}[1]{%
142 \index{direttiva!{#1}@{{\tt {#1}}}}\texttt{#1}%
143 %\index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
146 \newcommand{\file}[1]{\texttt{#1}} % file name
147 \newcommand{\link}[1]{\texttt{#1}} % html link
148 \newcommand{\ctyp}[1]{\texttt{#1}} % C standard type
150 \newcommand{\headfile}[1]{%
151 \index{file!include!{#1}@{{\tt {#1}}}}\texttt{#1}%
152 %\index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
154 \newcommand{\procfile}[1]{%
155 \index{file!filesystem~\texttt{/proc}!{#1}@{{\tt {#1}}}}\texttt{#1}%
156 %\index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
158 \newcommand{\sysfile}[1]{%
159 \index{file!di~sistema!{#1}@{{\tt {#1}}}}\texttt{#1}%
160 %\index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
162 \newcommand{\conffile}[1]{%
163 \index{file!di~configurazione!{#1}@{{\tt {#1}}}}\texttt{#1}%
164 %\index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
165 } % configuration file name
166 \newcommand{\procrelfile}[2]{%
167 \index{file!filesystem~\texttt{/proc}!{#2}@{{\tt {#1}/{#2}}}}\texttt{#2}%
168 %\index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
172 \newcommand{\type}[1]{%
173 \index{tipo!{#1}@{{\tt {#1}}}}\texttt{#1}%
174 %\index{#1@{{\tt {#1}} (tipo)}}\texttt{#1}%
176 \newcommand{\struct}[1]{%
177 \index{struttura dati!{#1}@{{\tt {#1}}}}\texttt{#1}%
178 %\index{#1@{{\tt {#1}} (struttura dati)}}\texttt{#1}%
180 \newcommand{\structd}[1]{%
181 \index{struttura dati!{#1}@{{\tt {#1}}}!definizione di}\texttt{#1}%
182 %\index{#1@{{\tt {#1}} (struttura dati)}!definizione di}\texttt{#1}%
184 \newcommand{\param}[1]{\texttt{#1}} % function parameter
185 \newcommand{\acr}[1]{\textsl{#1}} % acrostic (for pid, suid, ecc.)
187 \newcommand{\itindex}[1]{%
188 \index{#1@{\textit{#1}}}%
191 \newcommand{\itindbeg}[1]{%
192 \index{#1@{\textit{#1}}|(}%
194 \newcommand{\itindend}[1]{%
195 \index{#1@{\textit{#1}}|)}%
197 \newcommand{\itindsub}[2]{%
198 \index{#1@{\textit{#1}}!\textit{#2}}%
201 % Aggiunte di Mirko per la gestione delle tabelle complicate come immagini
202 % nella traslazione in HTML
203 \newenvironment{usepicture}{}{}{}{}
207 %%% TeX-master: "gapil"