%%
%% This is file `conv-xkv.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% conv-xkv.dtx  (with options: `copyright,package')
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% conv-xkv package                                      %%
%% Copyright (C) 2016--2017  D. P. Story                 %%
%%   dpstory@uakron.edu                                  %%
%%                                                       %%
%% This program can redistributed and/or modified under  %%
%% the terms of the LaTeX Project Public License         %%
%% Distributed from CTAN archives in directory           %%
%% macros/latex/base/lppl.txt; either version 1.2 of the %%
%% License, or (at your option) any later version.       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{conv-xkv}
 [2017/02/17 v1.1c convert xkeyval format (dps)]
\RequirePackage{xkeyval}
\begingroup
  \@makeother\`%
  \@makeother\=%
  \edef\x{%
    \edef\noexpand\x{%
      \endgroup
      \noexpand\toks@{%
        \catcode 96=\noexpand\the\catcode`\noexpand\`\relax
        \catcode 61=\noexpand\the\catcode`\noexpand\=\relax
      }%
    }%
    \noexpand\x
  }%
\x
\@makeother\`
\@makeother\=
\def\ckv@SetCatcodes{%
  \@makeother\`%
  \@makeother\=%
  \@makeother\~%
  \catcode`\$=3 %
  \catcode`\&=4 %
  \catcode`\^=7 %
  \catcode`\_=8 %
  \@makeother\|%
  \@makeother\:%
  \@makeother\(%
  \@makeother\)%
  \@makeother\[%
  \@makeother\]%
  \@makeother\/%
  \@makeother\!%
  \@makeother\<%
  \@makeother\>%
  \@makeother\.%
  \@makeother\;%
  \@makeother\+%
  \@makeother\-%
  \@makeother\"%
  \@makeother\'%
}
\begingroup
  \def\x#1{\catcode`\noexpand#1=\the\catcode`#1\relax}%
  \xdef\ckv@RestoreCatcodes{%
    \the\toks@
    \x\~%
    \x\$%
    \x\&%
    \x\^%
    \x\_%
    \x\|%
    \x\:%
    \x\(%
    \x\)%
    \x\[%
    \x\]%
    \x\/%
    \x\!%
    \x\<%
    \x\>%
    \x\.%
    \x\;%
    \x\+%
    \x\-%
    \x\"%
    \x\'%
  }%
\endgroup
\ckv@SetCatcodes
\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
\csarg\def{kvdelim-colon}{:}
\def\usekvdelim#1{\@nameuse{kvdelim-#1}}
\def\DeclareDelimiter{\ckv@SetCatcodes\DeclareDelimiter@i}
\def\DeclareDelimiter@i#1#2{\@ifundefined{kvdelim-#1}
    {\csarg\def{kvdelim-#1}{#2}\ckv@RestoreCatcodes\cxkvSetup{#1}}
    {\ckv@RestoreCatcodes}}
\@onlypreamble\DeclareDelimiter
\newtoks\cxkv@tmptoks \cxkv@tmptoks={}
\def\cxkv@dummy{dummy}
\def\cxkv@dummyc{dummy,}
\bgroup
    \catcode`\#=12\relax\gdef\cxkvarg{#}
    \obeyspaces\gdef\cxkv@TAB{    }
\egroup
\def\cxkv@colon{colon}
\newcommand\cxkvsetkeys{%
    \@ifnextchar({\cxkvsetkeys@i}{\cxkvsetkeys@i(colon)}}
\def\cxkvsetkeys@i(#1){\cxkvsetkeys@ii{#1}}
\def\cxkvsetkeys@ii#1{\def\cxkv@delimname{#1}\@ifstar
    {\def\cxkv@skOpts{*}\cxkvsetkeys@iii}
    {\def\cxkv@skOpts{}\cxkvsetkeys@iii}}
\newcommand\cxkvsetkeys@iii[2][]{\def\@rgi{#1}\ifx\@rgi\@empty
    \expandafter\def\expandafter\cxkv@skOpts
        \expandafter{\cxkv@skOpts{#2}}\else
    \expandafter\def\expandafter
        \cxkv@skOpts\expandafter{\cxkv@skOpts[#1]{#2}}\fi
    \def\thisxkvF@mily{#2}\cxkvsetkeys@iv}
\newcommand\cxkvsetkeys@iv[2][]{\def\@rgi{#1}\ifx\@rgi\@empty\else
    \expandafter\def\expandafter\cxkv@skOpts
        \expandafter{\cxkv@skOpts[#1]}\fi
    \expandafter\cxkvsetkeys@v\expandafter{\thisxkvF@mily}{#2}}
\def\cxkvsetkeys@v#1#2{\cxkv@skipfalse
    \ifx\cxkv@delimname\cxkv@colon\else
        \InputIfFileExists{xkv-\cxkv@delimname.cut}
        {\PackageInfo{conv-xkv}{Inputting xkv-\cxkv@delimname.cut}}
        {\PackageInfo{conv-xkv}{Cannot find xkv-\cxkv@delimname.cut}}\fi
    \@nameuse{cxkvsetkeys-\cxkv@delimname}{#1}{#2}}
\csarg\def{cxkvsetkeys-colon}#1#2{%
    \def\thisxkvF@mily{#1}\def\thisxkvV@lues{#2}\def\cxkv@scratch{}%
    \cxkv@tmptoks={}%
    \@nameuse{cxkv@cnvrtDelimniiEqual-colon}#2,dummy:dummy,\@nil}
\csarg\def{cxkv@cnvrtDelimniiEqual-colon}#1:#2,#3\@nil{%
    \cxkv@cnvrtDelimniiEquali{colon}{#1}{#2}{#3}}
\def\cxkvSetup#1{\bgroup
\IfFileExists{xkv-#1.cut}{\PackageInfo{conv-xkv}{xkv-#1.cut
    already exists,\MessageBreak will not create another one}}{%
    \PackageInfo{conv-xkv}{Creating the file xkv-#1.cut
        containing\MessageBreak required definitions}%
    \newwrite \cxkv@write
    \uccode`c=`\%
    \def\w{#1}\def\x{cxkvsetkeys-#1}%
    \def\y{cxkv@cnvrtDelimniiEqual-#1}%
    \def\z{kvdelim-#1}%
    \immediate\openout \cxkv@write xkv-#1.cut
    \immediate\write\cxkv@write{\string\makeatletter}%
    \uppercase{\immediate\write\cxkv@write{\string
        \csarg\string\def{\y}\cxkvarg1\@nameuse{\z}%
        \cxkvarg2,\cxkvarg3\string\@nil{c^^J\cxkv@TAB
        \string\cxkv@cnvrtDelimniiEquali{\w}{\cxkvarg1}%
        {\cxkvarg2}{\cxkvarg3}}}}
    \uppercase{\immediate\write\cxkv@write{\string\csarg\string\def
        {\x}\cxkvarg1\cxkvarg2{c^^J\cxkv@TAB
        \string\def\string\thisxkvF@mily{\cxkvarg1}\string
        \def\string\thisxkvV@lues{\cxkvarg2}\string
        \let\string\cxkv@scratch\string\@empty\string
        \cxkv@tmptoks={}c^^J\cxkv@TAB
        \string\@nameuse{\y}\cxkvarg2,%
        \cxkv@dummy\@nameuse{\z}\cxkv@dummy,\string\@nil}}}
    \immediate\write\cxkv@write{\string\makeatother}%
    \immediate\closeout \cxkv@write
}%
\egroup}
\newif\ifcxkv@keyonly \cxkv@keyonlyfalse
\def\cxkv@comma{,}
\def\cxkv@removecomma#1,\@nil{\def\cxkv@key{#1}}
\def\cxkv@parsecomma#1,#2\@nil{\def\@rgi{#1}\def\@rgii{#2}%
    \ifx\@rgii\@empty\cxkv@keyonlyfalse\else
        \cxkv@keyonlytrue\cxkv@removecomma#2\@nil\fi}
\newif\ifcxkv@skip \cxkv@skipfalse
\def\cxkv@cnvrtDelimniiEquali#1#2#3#4{%
    \def\cxkv@rgiii{#3}\def\cxkv@rgiv{#4}%
    \ifx\thisxkvV@lues\@empty\else
        \ifx\cxkv@rgiv\@empty
            \edef\cxkv@next{\noexpand
                \setkeys\cxkv@skOpts{\thisxkvV@lues}}%
            \cxkv@skiptrue
        \fi
    \fi
    \let\thisxkvV@lues\@empty
    \ifcxkv@skip\else
    \ifx\cxkv@rgiii\cxkv@dummy
        \cxkv@parsecomma#2,\@nil
        \ifcxkv@keyonly
            \edef\cxkv@tmp{\the\cxkv@tmptoks,\@rgi}%
            \cxkv@tmptoks=\expandafter{\cxkv@tmp}%
            \edef\cxkv@scratch{\the\cxkv@tmptoks}%
            \edef\cxkv@next{\noexpand
                \setkeys\cxkv@skOpts{\the\cxkv@tmptoks}}%
        \else
            \edef\cxkv@next{\noexpand
                \setkeys\cxkv@skOpts{\the\cxkv@tmptoks}}%
        \fi
    \else
        \cxkv@parsecomma#2,\@nil
        \ifcxkv@keyonly
            \edef\cxkv@tmp{\the\cxkv@tmptoks,\@rgi}%
            \cxkv@tmptoks=\expandafter{\cxkv@tmp}%
            \edef\cxkv@scratch{\the\cxkv@tmptoks}%
            \edef\cxkv@next{\noexpand
                \@nameuse{cxkv@cnvrtDelimniiEqual-#1}\cxkv@key
                \@nameuse{kvdelim-#1}#3,#4\noexpand\@nil}
        \else
            \cxkv@tmptoks=\expandafter{\cxkv@scratch,#2={#3}}%
            \edef\cxkv@scratch{\the\cxkv@tmptoks}%
            \def\cxkv@next{%
                \@nameuse{cxkv@cnvrtDelimniiEqual-#1}#4\@nil}\fi
    \fi\fi\cxkv@next
}
\ckv@RestoreCatcodes
\endinput
%%
%% End of file `conv-xkv.sty'.
