% Copyright 2005 by Till Tantau <tantau@users.sourceforge.net>.
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 2.

% The purpose of this file is to define the command
% \ProvidesPackageRCS, which should be followed by an RCS id
% string. This command will also be available in plain TeX, where it
% prints out a message to the log.


\def\pgfversion{1.01}


\ifx\pgfrcsloaded\undefined
\def\pgfrcsloaded{}

\edef\pgfrcsatcode{\the\catcode`\@}
\catcode`\@=11

\def\@empty{}

% Get date and version from RCS Ids
\def\pgf@parseid $#1: #2.#3,v #4 #5/#6/#7 #8${%
  \pgf@parsercsfile$#2/$
  \def\pgf@rcssuffix{#3}
  \def\pgf@rcsrevision{#4}
  \def\pgf@rcsdate{#5/#6/#7}
}
\def\pgf@parsercsfile$#1/#2${
  \def\pgf@temp{#2}
  \ifx\pgf@temp\@empty
    \def\pgf@rcsfile{#1}
  \else
    \pgf@parsercsfile$#2$
  \fi}

\def\ProvidesFileRCS $#1${
  \pgf@parseid $#1$
  \ProvidesFile{\pgf@rcsfile.\pgf@rcssuffix}[\pgf@rcsdate\space (rcs-revision \pgf@rcsrevision)]
}

\def\ProvidesPackageRCS{%
  \def\pgf@rcsadditional{}%
  \afterassignment\pgfrcs@checkforoptional\let\next=}

\def\pgfrcs@checkforoptional{%
  \ifx\next[%
    \let\next=\pgfrcs@getoptional%
  \else
    \let\next=\pgfrcs@package%
  \fi%
  \next}%}

\def\pgfrcs@getoptional#1] ${%
  \def\pgf@rcsadditional{#1}%
  \pgfrcs@package%
}

\def\pgfrcs@package#1${
  \pgf@parseid $#1$
  \ProvidesPackage{\pgf@rcsfile}[\pgf@rcsdate\space\pgf@rcsadditional\space(rcs-revision \pgf@rcsrevision)]
}

\def\ProvidesClassRCS $#1$ [#2]{%
  \pgf@parseid $#1$
  \ProvidesClass{\pgf@rcsfile}[\pgf@rcsdate\space#2\space (rcs-revision \pgf@rcsrevision)]
}

\ifx\ProvidesPackage\@undefined
  % plain tex
  \def\ProvidesPackage#1[#2]{\wlog{Loading package #1 version #2.}}
\fi

\ifx\ProvidesFile\@undefined
  % plain tex
  \def\ProvidesFile#1[#2]{\wlog{Loading file #1 version #2.}}
\fi

\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgfrcs.code.tex,v 1.8 2005/11/14 17:37:52 tantau Exp $

\catcode`\@=\pgfrcsatcode

\fi

