%
%   $Id: fpc-html.tex,v 1.4 2001/11/16 04:37:24 carl Exp $
%
%   This file is part of the FPC documentation.
%   Copyright (C) 1997, by Michael Van Canneyt
%
%   The FPC documentation is free text; you can redistribute it and/or
%   modify it under the terms of the GNU Library General Public License as
%   published by the Free Software Foundation; either version 2 of the
%   License, or (at your option) any later version.
%
%   The FPC Documentation is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%   Library General Public License for more details.
%
%   You should have received a copy of the GNU Library General Public
%   License along with the FPC documentation; see the file COPYING.LIB.  If not,
%   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
%   Boston, MA 02111-1307, USA.

\usepackage{ifthen}
\usepackage{xspace}
\usepackage{multicol}

%
% FPC environments
%
% List
\newenvironment{FPCList}{\begin{htmllist}}{\end{htmllist}}
% For Tables.
\newenvironment{FPCtable}[2]{\begin{table}\caption{#2}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
% The same, but with label in third argument (tab:#3)
\newenvironment{FPCltable}[3]{\begin{table}\caption{#2}\label{tab:#3}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}

%
% Picture including with breaks before and after
%
\newcommand{\fpcaddimg}[1]{\htmlclear\htmlclear\htmladdimg{#1}\htmlclear\htmlclear}

%
% Html Refs
%
\newcommand{\seefl}[2]{\htmlref{#1}{fu:#2}}
\newcommand{\seepl}[2]{\htmlref{#1}{pro:#2}}
\newcommand{\seetyl}[1]{\htmlref{#1}{sec:types}}
\newcommand{\seec}[1]{chapter \htmlref{#1}{ch:#1}}
\newcommand{\sees}[1]{section \htmlref{#1}{se:#1}}
\newcommand{\seeo}[1]{See \htmlref{#1}{option:#1}}
\newcommand{\seet}[1]{table (\htmlref{#1}{tab:#1}) }

%
% Function list
%
\newenvironment{funclist}{\begin{list}}{\end{list}}
\newcommand{\funcrefl}[3]{\item[\htmlref{#2}{fu:#2} #3]}
\newcommand{\funcref}[2]{\item[\htmlref{#1}{fu:#1} #2]}
\newcommand{\procrefl}[3]{\item[\htmlref{#2}{pro:#2} #3]}
\newcommand{\procref}[2]{\item[\htmlref{#1}{pro:#1} #2]}

%
% Function/procedure environments
%
\newenvironment{functionl}[2]{\subsection{#1}\index{#1}\label{fu:#2}\begin{FPCList}}{\end{FPCList}}
\newenvironment{procedurel}[2]{\subsection{#1}\index{#1}\label{pro:#2}\begin{FPCList}}{\end{FPCList}}
\newenvironment{function}[1]{\begin{functionl}{#1}{#1}}{\end{functionl}}
\newenvironment{procedure}[1]{\begin{procedurel}{#1}{#1}}{\end{procedurel}}
\newenvironment{typel}[2]{\subsection{#1}\index{#1}\label{ty:#2}\begin{FPCList}}{\end{FPCList}}
\newenvironment{type}[1]{\begin{typel}{#1}{#1}}{\end{typel}}
\newcommand{\Declaration}{\item[Declaration]\ttfamily}
\newcommand{\Description}{\item[Description]\rmfamily}
\newcommand{\Errors}{\item[Errors]\rmfamily}
\newcommand{\SeeAlso}{\item[See also]\rmfamily}
%
% Ref without labels
%
\newcommand{\seef}[1]{\seefl{#1}{#1}}
\newcommand{\seep}[1]{\seepl{#1}{#1}}
\newcommand{\seety}[1]{\seetyl{#1}{#1}}
%
% man page references don't need labels.
%
\newcommand{\seem}[2]{\texttt{#1} (#2) }
%
% for easy typesetting of variables.
%
\newcommand{\var}[1]{\texttt {#1}}
\newcommand{\file}[1]{\textsf {#1}}
%
% Useful references.
%
\newcommand{\progref}{\htmladdnormallink{Programmers' guide}{../prog/prog.html}\xspace}
\newcommand{\refref}{\htmladdnormallink{Reference guide}{../ref/ref.html}\xspace}
\newcommand{\userref}{\htmladdnormallink{Users' guide}{../user/user.html}\xspace}
\newcommand{\unitsref}{\htmladdnormallink{Unit reference}{../rtl/index.html}\xspace}
\newcommand{\seecrt}{\htmladdnormallink{CRT}{../rtl/crt/index.html}\xspace}
\newcommand{\seelinux}{\htmladdnormallink{Linux}{../linux/linux.html}\xspace}
\newcommand{\seestrings}{\htmladdnormallink{strings}{../rtl/strings/index.html}\xspace}
\newcommand{\seedos}{\htmladdnormallink{DOS}{../rtl/dos/index.html}\xspace}
\newcommand{\seegetopts}{\htmladdnormallink{getopts}{../rtl/getopts/index.html}\xspace}
\newcommand{\seeobjects}{\htmladdnormallink{objects}{../rtl/objects/index.html}\xspace}
\newcommand{\seegraph}{\htmladdnormallink{graph}{../rtl/graph/index.html}\xspace}
\newcommand{\seeprinter}{\htmladdnormallink{printer}{../rtl/printer/index.html}\xspace}
\newcommand{\seego}{\htmladdnormallink{GO32}{../rtl/go32/index.html}\xspace}
%
% Commands to reference these things.
%
\newenvironment{remark}{\par\makebox[0pt][r]{\bfseries{}Remark:\hspace{.25em}}}{\par}
\newcommand{\olabel}[1]{\label{option:#1}}
%
% some OSes
%
\newcommand{\linux}{\textsc{linux}\xspace}
\newcommand{\unix}{\textsc{unix}\xspace}
\newcommand{\dos}  {\textsc{dos}\xspace}
\newcommand{\msdos}{\textsc{ms-dos}\xspace}
\newcommand{\ostwo}{\textsc{os/2}\xspace}
\newcommand{\windows}{\textsc{Windows}\xspace}
\newcommand{\windowsnt}{\textsc{Windows NT}\xspace}
\newcommand{\fpc}{Free Pascal\xspace}
\newcommand{\gnu}{\textsc{gnu}\xspace}
\newcommand{\atari}{\textsc{Atari}\xspace}
\newcommand{\amiga}{\textsc{Amiga}\xspace}
\newcommand{\win}{\textsc{Win32}\xspace}
\newcommand{\freebsd}{\textsc{FreeBSD}\xspace}
%
% Some versions
%
\newcommand{\fpcversion}{1.0.6}
%
% PDF support
%
\latex{%
  \newif\ifpdf
  \ifx\pdfoutput\undefined
     \pdffalse
  \else
     \pdfoutput=1
     \pdftrue
  \fi
}
%
% end of fpc-html.tex
%
