% *************************************************************************
% *                             vs-version                                *
% *          A LaTeX package for documents with severel versions          *
% *                                                                       *
% *                           Vincent Simonet                             *
% *************************************************************************
%
% Copyright Vincent Simonet 2002, all right reserved.
% Distributed only by permission.
%
% Vincent.Simonet@inria.fr
% http://cristal.inria.fr/~simonet/

\ProvidesPackage{vs-version}[2002/04/25]

\RequirePackage{moreverb}



% -------------------------------------------------------------------------
% Declaring a new version

\def\vs@declareversion#1{
%
  \expandafter\def\csname vsversion@#1\endcsname{#1}
%
  \expandafter\def\csname if#1\endcsname##1{%
    \expandafter\ifx\csname vsversion@#1\endcsname\version##1\fi%
    }
  \expandafter\def\csname ifnot#1\endcsname##1{%
    \expandafter\ifx\csname vsversion@#1\endcsname\version\else##1\fi%
    }
%
  \expandafter\def\csname #1\endcsname{\protect%
    \expandafter\ifx\csname vsversion@#1\endcsname\version%
    \else%
    \comment
    \fi%
    }
%
  \expandafter\def\csname end#1\endcsname{\protect%
    \expandafter\ifx\csname vsversion@#1\endcsname\version%
    \else%
    \endcomment
    \fi%
    }
}



% -------------------------------------------------------------------------
% Setting the current version

\def\vs@selectversion#1{\gdef\version{#1}}
\def\vs@defaultversion#1{\ifx\version\undefined \vs@selectversion{#1}\fi}



% -------------------------------------------------------------------------
% Exported macros

\let\declareversion=\vs@declareversion
\let\selectversion=\vs@selectversion
\let\defaultversion=\vs@defaultversion
