%%
%% This is file `rdfmeta.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% rdfmeta.dtx  (with options: `package')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{rdfmeta}[2010/09/01 v0.2 Metadata key upgrades]
\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}}
\newif\if@rdfmeta@sectioning\@rdfmeta@sectioningfalse
\DeclareOption{sectioning}{\@rdfmeta@sectioningtrue}
\ProcessOptions
\RequirePackage{sref}
\def\@yes@{yes}
\addmetakey*{upgrade}{idlabel}
\addmetakey*{upgrade}{optarg}
\addmetakey*[yes]{upgrade}{optargstar}
\addmetakey*{upgrade}{keygroup}
\def\rdfmeta@upgrade{\@ifstar\rdfmeta@upgrade@star\rdfmeta@upgrade@nostar}
\newcommand\rdfmeta@upgrade@nostar[2][]{\metasetkeys{upgrade}{#1}%
\ifx\upgrade@keygroup\@empty\def\@@group{#2}\else\def\@@group{\upgrade@keygroup}\fi
\ifx\upgrade@optarg\@empty\message{**** no optarg}
\rdfmeta@upgrade@base{#2}{}
\else\message{**** optarg case: @@group=\@@group, upgrade@optarg=\upgrade@optarg}
\addmetakey@nostar\@@group\upgrade@optarg
\rdfmeta@upgrade@base{#2}{\@@group @\upgrade@optarg}
\fi}
\newcommand\rdfmeta@upgrade@star[2][]{\metasetkeys{upgrade}{#1}%
\ifx\upgrade@keygroup\@empty\def\@@group{#2}\else\def\@@group{\upgrade@keygroup}\fi
\addmetakey*\@@group{\upgrade@optarg}
\rdfmeta@upgrade@base@star{#2}{\@nameuse{\@@group @\upgrade@optarg}}
}

\newcommand{\rdfmeta@upgrade@base}[2]{\@ifundefined{#1}%
{\message{rdfmeta warning: trying to upgrade undefined macro}}%
{\srefaddidkey{#1}%
\expandafter\let\csname rdfmeta@#1@old\expandafter\endcsname\csname #1\endcsname%
\ifx\upgrade@optarg\@empty
\expandafter\renewcommand\csname #1\endcsname[2][]%
{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}{##2}}
\else\message{***** else case: arg1=#1, arg2=#2}
\expandafter\renewcommand\csname #1\endcsname[2][]%
{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}[\@nameuse{#2}]{##2}}
\fi}}

\newcommand{\rdfmeta@upgrade@base@star}[2]{\@ifundefined{#1}{}%
{\srefaddidkey{#1}%
\expandafter\let\csname rdfmeta@#1@old\expandafter\endcsname\csname #1\endcsname%
\expandafter\def\csname #1\endcsname%
{\@ifstar{\@nameuse{rdfmeta@#1@star}}{\@nameuse{rdfmeta@#1@nostar}}}%
\expandafter\newcommand\csname rdfmeta@#1@nostar\endcsname[2][]%
{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}[#2]{##2}}%
\ifx\upgrade@optargstar\@yes@%
\expandafter\newcommand\csname rdfmeta@#1@star\endcsname[2][]%
{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}*[#2]{##2}}%
\else%
\expandafter\newcommand\csname rdfmeta@#1@star\endcsname[2][]%
{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}*{##2}}%
\fi%
\addmetakey*\@@group{\upgrade@optarg}}}
\newcommand\keydef[2]{\addmetakey{#1}{#2}\symdef{#2}{\text{#2}}}
\if@rdfmeta@sectioning
\rdfmeta@upgrade*[optarg=short,optargstar=no]{part}
\rdfmeta@upgrade*[optarg=short,optargstar=no]{chapter}
\rdfmeta@upgrade*[optarg=short,optargstar=no]{section}
\rdfmeta@upgrade*[optarg=short,optargstar=no]{subsection}
\rdfmeta@upgrade*[optarg=short,optargstar=no]{subsubsection}
\rdfmeta@upgrade*[optarg=short,optargstar=no]{paragraph}
\fi
\endinput
%%
%% End of file `rdfmeta.sty'.
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "test"
%%% End: 
