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
60 \begin{boxedminipage}[c]{14cm}
62 \begin{description*}{}{}
63 \item \texttt{\#include <#1>}
64 \item \texttt{#2} \par
65 % \begin{lstlisting}{}
70 {% defining what is done by \end
79 \newenvironment{errlist}{\begin{basedescript}{\desclabelwidth{1.5cm}}}
82 % Slighty different envirnoment to be used for multi-header,
83 % multi-functions boxed description
85 \newcommand{\headdecl}[1]{\item\texttt{\#include <#1>}}
86 \newcommand{\funcdecl}[1]{\item\texttt{#1}\par}
87 \newcommand{\bodydesc}[1]{\par \end{description*} #1
88 \begin{description*}{}{} \baselineskip=0pt
92 \newenvironment{functions}
93 {% defining what is done by \begin
96 \begin{boxedminipage}[c]{14cm}
98 \begin{description*}{}{}
100 {% defining what is done by \end
109 % Wrapper for shell command, functions, filenames, links,
110 % variables, macros, and everything can be useul,
112 \newcommand{\cmd}[1]{\texttt{#1}} % shell command
113 \newcommand{\code}[1]{\texttt{#1}} % for simple code
114 \newcommand{\func}[1]{%
115 \index{#1@{{\tt {#1}} (funzione)}}\texttt{#1}%
117 \newcommand{\funcd}[1]{%
118 \index{#1@{{\tt {#1}} (funzione)}!definizione di}\texttt{#1}%
120 \newcommand{\macro}[1]{%
121 \index{#1@{{\tt {#1}} (macro)}}\texttt{#1}%
123 \newcommand{\errcode}[1]{%
124 \index{#1@{{\tt {#1}} (errore)}}\texttt{#1}%
126 \newcommand{\errval}[1]{\texttt{#1}} % value
127 \newcommand{\var}[1]{\texttt{#1}} % variable
128 \newcommand{\val}[1]{\texttt{#1}} % value
129 \newcommand{\const}[1]{%
130 \index{#1@{{\tt {#1}} (costante)}}\texttt{#1}%
132 \newcommand{\direct}[1]{%
133 \index{#1@{{\tt {#1}} (direttiva)}}\texttt{#1}%
135 \newcommand{\file}[1]{\texttt{#1}} % file name
136 \newcommand{\link}[1]{\texttt{#1}} % html link
137 \newcommand{\ctyp}[1]{\texttt{#1}} % C standard type
138 \newcommand{\type}[1]{%
139 \index{#1@{{\tt {#1}} (tipo)}}\texttt{#1}%
141 \newcommand{\struct}[1]{%
142 \index{#1@{{\tt {#1}} (struttura dati)}}\texttt{#1}%
144 \newcommand{\structd}[1]{%
145 \index{#1@{{\tt {#1}} (struttura dati)}!definizione di}\texttt{#1}%
147 \newcommand{\param}[1]{\texttt{#1}} % function parameter
148 \newcommand{\acr}[1]{\textsl{#1}} % acrostic (for pid, suid, etc.)
153 %%% TeX-master: "gapil"