%%
%% This is file `interfaces-base.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% interfaces.dtx  (with options: `base')
%% 
%% This is a generated file.
%% 
%% interfaces : 2010/12/27 v2.6 - interfaces : interfaces with keys for other packages (FC)
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work consists of the main source file interfaces.dtx
%% and the derived files
%%     interfaces.sty, interfaces.pdf, interfaces.ins,
%%     interfaces-base.sty,
%%     interfaces-LaTeX.sty,
%%     interfaces-graphics.sty,
%%     interfaces-tikz.sty,
%%     interfaces-titlesec.sty,
%%     interfaces-hyperref.sty,
%%     interfaces-bookmark.sty,
%%     interfaces-hypbmsec.sty,
%%     interfaces-fancyhdr.sty,
%%     interfaces-marks.sty,
%%     interfaces-tocloft.sty,
%%     interfaces-makecell.sty,
%%     interfaces-enumitem.sty,
%%     interfaces-truncate.sty,
%%     interfaces-appendix.sty,
%%     interfaces-embedfile.sty,
%%     interfaces-environ.sty,
%%     interfaces-umrand.sty,
%%     interfaces-scrlfile.sty,
%%     interfaces-pgfkeys.sty,
%%     interfaces-etoolbox.sty
%% 
%% interfaces: interfaces with keys for other packages (FC)
%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
%% 
\ProvidesPackage{interfaces-base}
   [2010/12/27 v2.6 Interfaces core system layer (FC)]
\RequirePackage{etex,ltxcmds,etoolbox,pgfkeys,scrlfile,infwarerr}
\AtEndOfPackage{%
   \RequirePackage{interfaces-etoolbox}%
   \RequirePackage{interfaces-scrlfile}%
   \RequirePackage{interfaces-pgfkeys}
   \RequirePackage{interfaces-tikz}%
   \RequirePackage{interfaces-umrand}% There is a \BeforePackage here !
}% AtEndOfPackage
\newrobustcmd*\LoadInterface[1]{%
   \@for\itf@tp:=#1\do{%
      \expandafter\ifx\csname\ifcsname\itf@tp\endcsname
                        \itf@tp\else relax\fi\endcsname\marks
         \RequirePackage{interfaces-marks}%
      \else\expandafter\ifx\csname\ifcsname\itf@tp\endcsname
                        \itf@tp\else relax\fi\endcsname\LaTeX
         \RequirePackage{interfaces-LaTeX}%
      \else
         \expandafter\itf@LoadInterface\expandafter{\itf@tp}%
      \fi\fi}%
}% \LoadInterface
\@onlypreamble\LoadInterface
\newrobustcmd*\itf@LoadInterface[1]{\ltx@ifpackageloaded{interfaces-#1}
   {}
   {\AfterPackage*{#1}{\RequirePackage{interfaces-#1}}}%
}% \itf@LoadInterface
\newrobustcmd*\itf@Check@Package[1]{\itf@pgfkeys\ltx@ifpackageloaded{#1}
   {}
   {\PackageError{interfaces-#1}
      {The package `#1` must be loaded before `interfaces-#1`
      \MessageBreak Please refer to `interfaces.pdf` document
      \MessageBreak for correct usage of the `interfaces` package}\@ehd
   }%
}% \itf@Check@Package
\newrobustcmd*\itf@AfterPackage[1]{%
   \csname\ltx@ifpackageloaded{#1}{ltx@secondoftwo}{@AfterPackage}\endcsname{#1}%
}% \itf@AfterPackage
\AfterPackage{colortbl}{%
   {\ltx@ifpackageloaded{arydshln}
      {\@PackageWarningNoLine{interfaces-base}
         {The package arydshln should be loaded after colortbl
         \MessageBreak because both redefine \string\@classz}}%
      {}}%
}% AfterPackage colortbl
\newrobustcmd*\itf@preapptocmd[5]{%
   \pretocmd#1{#2}%
      {\apptocmd#1{#3}%
         {#4}%
         {#5}}%
      {#5}%
}% \itf@preapptocmd
\def\itf@patch{\@makeother\#\futurelet\itf@tp\itf@patch@}
\def\itf@patch@{\csname itf@patch@%
      \ifx\itf@tp\patchcmd inside\else
      \ifx\itf@tp\itf@preapptocmd inside\else
      boundary\fi\fi
   \endcsname
}% \itf@patch@
\def\itf@patch@boundary#1#2#3#4#5{%
   \catcode`\#=6%
   \let\itf@tp#2%
   #1\itf@tp{#3}%
   {\let#2\itf@tp
    \AtBeginDocument{#4}% in order to keep this info even after \dump
   }
   {#5}%
}% \itf@patch@boundary (for \pretocmd and \apptocmd)
\def\itf@patch@inside#1#2#3#4#5#6{%
   \catcode`\#=6%
   \let\itf@tp#2%
   #1\itf@tp{#3}{#4}%
   {\ifx#1\patchcmd \itf@patch@inside@{#1}{#3}{#4}\fi
    \let#2\itf@tp
    \AtBeginDocument{#5}%
   }
   {#6}%
}% \itf@patch@inside (for \patchcmd)
\def\itf@patch@inside@#1#2#3{%
   \loop
      \let\@tempa \itf@tp
      #1\itf@tp{#2}{#3}{}{}%
      \unless\ifx \@tempa\itf@tp
   \repeat
}% \itf@patch@inside@
\newskip\itf@sk
\newmuskip\itf@musk
\newtoks\itf@tk
\newcount\itf@cnt
%%   H E L P E R   M A C R O S
\begingroup\makeatother
   \csgdef{itf@strip@at}#1@{}
\endgroup
\def\itf@strip@dot#1.#2\@nil{#1}
\def\itf@expandonceifcs#1{\expandafter\itf@exp@ndonceifcs\expandafter#1#1Q\@nnil}
\def\itf@exp@ndonceifcs#1#2#3\@nnil{%
   \def\itf@tp{#2}%
   \ifx\itf@tp#1%
   \ifcat\relax\noexpand#2%
      \expandafter\expandafter\expandafter\remove@to@nnil
         \expandafter\ifx\expandafter#2#2\@nnil\else\@nnil\let#1#2\fi
   \fi\fi
}% \itf@exp@ndonceifcs
%%   G E T   A   N U M B E R (if possible)
%% USAGE: \itf@number\count<text>\relax\@nnil (like \@defaultunits)
\def\itf@number#1#2\relax\@nnil{% \relax is to mimick the syntax of \@defaultunits
   \afterassignment\itf@number@#1\number0#2\relax\itf@number@
}
\def\itf@number@#1\relax#2\itf@number@{%
   \ifblank{#1}
      {\itf@number@@{}#2\itf@number@@\@nnil
      \csname ltx@\ifx\@let@token\itf@number@@
         first\else second\fi oftwo\endcsname}
      \ltx@secondoftwo
}% \itf@number@
\def\itf@number@@#1{\futurelet\@let@token\itf@number@@@}
\def\itf@number@@@{%
   \csname \ifx\@let@token\relax itf@number@@%
   \else remove@to@nnil%
   \fi \endcsname
}% \itf@number@@@
\protected\def\itf@setlength#1#2{#1\glueexpr#2\relax}
%% glue * 1.5 = glue * 98302 / 65536
%% glue * 3/2 = glue * 3/2
\def\itf@units@scale#1!{\itf@units@scale@normalize#1/\@nnil/\@nil}
\def\itf@units@scale@normalize#1/#2/#3\@nil{%
   \ifx#2\@nnil \number\dimexpr#1pt\relax/65536
   \else#1/#2
   \fi
}% \itf@units@scale@normalize
\def\itf@units@scaleNoCalc#1!{\itf@units@scale@normalizeNoCalc#1/\@nnil/\@nil}
\let\itf@units@scale@normalizeNoCalc \itf@units@scale@normalize
\protected\def\itf@setlength@calc#1#2{\begingroup
   \let\calc@multiply@by@real \itf@calc@multiply@by@real
   \let\calc@Adimen \itf@calc@Askip  \let\calc@Bdimen \itf@calc@Bskip
   \setlength{#1}{#2}%
   \expandafter\endgroup\expandafter#1\the#1\relax
}% \itf@setlength@calc
\def\itf@units@scale@normalize@calc#1/#2/#3\@nil{%
   \ifx#2\@nnil 1*\ratio{\dimexpr#1pt\relax}\p@
   \else        1*\ratio{\dimexpr#1pt\relax}/{\dimexpr#2pt\relax}%
   \fi
}% \itf@units@scale@normalize@calc
\def\itf@calc@multiply@by@real#1{%
   \calc@Bdimen\glueexpr\calc@B*\number\dimexpr#1pt\relax/65536\relax
   \calc@B\calc@Bdimen
}% \itf@calc@multiply@by@real
\AfterPackage*{calc}{%
   \newskip\itf@calc@Askip \newskip\itf@calc@Bskip
   \let\itf@setlength \itf@setlength@calc
   \let\itf@units@scale@normalize \itf@units@scale@normalize@calc
}% AfterPackage calc
%%   U N I T S   F O R   D I M E N S
\def\itf@strip@mu{\expandafter\itf@rem@mu\the}
{%
\@makeother\M\@makeother\U
\lowercase{%
   \gdef\itf@rem@mu#1.#2MU{#1\ifnum#2>\z@.#2\fi}%
}}%
%% \skip = \itf@units@mutopt \muskip
\def\itf@units@pttomu#1{\gluetomu\glueexpr
   \glueexpr#1\relax*1800/%
      \expandafter\itf@strip@dot\the\dimexpr
            \fontdimen6\textfont2*100\relax.\@nil
   \relax
}% \itf@units@pttomu
\def\itf@units@mutopt#1{\glueexpr
   \mutoglue\muexpr#1\relax*
      \expandafter\itf@strip@dot\the\dimexpr
            \fontdimen6\textfont2*100\relax.\@nil/1800
   \relax
}% \itf@units@mutopt
%% \muskip = \itf@units@mu{ \skip or \muskip or number}
{%
\@makeother\P\@makeother\T\@makeother\S\@makeother\B
\@makeother\C\@makeother\M\@makeother\D\@makeother\I\@makeother\N
\lowercase{%
\gdef\itf@units@mu#1#2{\begingroup
   \edef\itf@tp{#2}%
   \@tfor\x:={PT}{pt}{PC}{pc}{IN}{in}{BP}{bp}%
             {CM}{cm}{MM}{mm}{DD}{dd}{CC}{cc}{SP}{sp}\do{%
      \@expandtwoargs\in@\x\itf@tp\ifin@\@break@tfor\fi
   }%
   \expandafter\endgroup
   \ifin@
      #1=\itf@units@pttomu{#2}%
   \else
      \@defaultunits#1 #2mu\relax\@nnil
   \fi
}% \itf@units@mu
}}
%% \skip = \itf@units@pt( \muskip or \skip or number )
{%
\@makeother\M\@makeother\U
\lowercase{%
\gdef\itf@units@pt#1#2{\begingroup
   \@expandtwoargs\in@{MU}{#2}%
   \ifin@\else\@expandtwoargs\in@{mu}{#2}\fi
   \expandafter\endgroup
   \ifin@
      #1=\itf@units@mutopt{#2}%
   \else
      \@defaultunits#1 #2pt\relax\@nnil
   \fi
}}}% \itf@units@pt
\AtBeginDocument{%
   \ltx@ifpackageloaded{xcolor}
      {\@ifundefinedcolor{default}
         {\colorlet{default}{.}}
         {}}%
      {\ltx@ifpackageloaded{color}
         {\@ifundefined{\string\color @default}
            {\expandafter\def\csname\string\color @default\endcsname{\default@color}}
            {}}%
      {}}%
}
\endinput
%%
%% End of file `interfaces-base.sty'.
