%% DESCRIPTION: LaTex style file for Vregs register definitions
%% Note you probably also want
%%  \usepackage{underscore}

%%============================================================
%% Constants, may be overridden

\newcommand{\vregsTableLinewidth}{\linewidth}

%%============================================================
%% Formatting macros used below (not for users)

\newcommand{\vregsPropertyBox}[2]{
\par\makebox[1.5in][l]{\textbf{#1}}
#2
\par
}

\newcommand{\vregsSubsection}[1]{
\if#1\empty
 \relax
\else
 \subsection{#1}
 \index{#1}
\fi
}

%%============================================================
%% Package and other top level types
%% Call as \vregsPackage{Package_Name}{section_description}
%% or just \vregsPackage{Package_Name} to skip the section header.

\newcommand{\vregsPackage}[2]{
\vregsSubsection{#2}
\label{#1}
\indent
\vregsPropertyBox{Package}{#1}
}

\newcommand{\vregsDefines}[2]{
\vregsSubsection{#2}
\label{#1}
\index{#1}
\indent
\vregsPropertyBox{Defines}{#1}
}

\newcommand{\vregsEnum}[2]{
\vregsSubsection{#2}
\label{#1}
\index{#1}
\indent
\vregsPropertyBox{Enum}{#1}
}

\newcommand{\vregsClass}[2]{
\vregsSubsection{#2}
\label{#1}
\index{#1}
\indent
\vregsPropertyBox{Class}{#1}
}

\newcommand{\vregsRegister}[2]{
\vregsSubsection{#2}
\label{#1}
\index{#1}
\indent
\vregsPropertyBox{Register}{#1}
}

%%============================================================
%% Attributes and things under packages/defines/enums/etc

\newcommand{\vregsAttributes}[1]{
\vregsPropertyBox{Attributes}{#1}
}

\newcommand{\vregsAddress}[1]{
\vregsPropertyBox{Address}{#1}
}

%%============================================================
%% Tables

\newenvironment{vregsTable}[1]{
\par
\vspace{10pt}
\tabularx{\vregsTableLinewidth}{#1}
}
{
\endtabularx
\par
}

\newcommand{\vregsTHead}[1]{
#1 \\
\hline
}

\newcommand{\vregsTLine}[1]{
#1 \\
}


%%============================================================
%% Tables

\newenvironment{vregsLongTable}[1]{
\par
\vspace{10pt}
\begin{longtable}{#1}
}
{
\end{longtable}
\par
}

\newcommand{\vregsLongTHead}[1]{
#1 \\
\hline \endfirsthead
#1 \\
\hline \endhead
}


%%============================================================
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% compile-command: "make"
%%% End:
