%%
%% This is file `zref-pageattr.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% zref.dtx  (with options: `pageattr')
%% 
%% This is a generated file.
%% 
%% Project: zref
%% Version: 2012/04/04 v2.24
%% 
%% Copyright (C) 2006-2012 by
%%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% This work consists of the main source file zref.dtx
%% and the derived files
%%    zref.sty, zref.pdf, zref.ins, zref.drv, zref-base.sty,
%%    zref-abspage.sty, zref-abspos.sty, zref-counter.sty,
%%    zref-dotfill.sty, zref-env.sty, zref-hyperref.sty,
%%    zref-lastpage.sty, zref-marks.sty, zref-nextpage.sty,
%%    zref-pageattr.sty, zref-pagelayout.sty, zref-perpage.sty,
%%    zref-runs.sty, zref-savepos.sty, zref-thepage.sty,
%%    zref-titleref.sty, zref-totpages.sty, zref-user.sty,
%%    zref-xr.sty, zref-example.tex, zref-example-lastpage.tex,
%%    zref-example-nextpage.tex, zref-test1.tex,
%%    zref-test-base.tex, zref-test-runs.tex,
%%    zref-test-titleref-memoir.tex.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zref-pageattr}%
  [2012/04/04 v2.24 Module pageattr for zref (HO)]%
\RequirePackage{zref-base}[2012/04/04]
\ifx\ZREF@base@ok Y%
\else
  \expandafter\endinput
\fi
\RequirePackage{ifluatex}[2010/03/01]
\ifluatex
  \ifnum\luatexversion<39 %
  \else
    \begingroup
      \escapechar=-1 %
      \def\ZREF@temp#1{%
        \ltx@IfUndefined{\string#1}{%
          \let#1\ltx@undefined
          \directlua{%
            if tex.enableprimitives then %
              tex.enableprimitives('', {'\string#1'})%
            end%
          }%
          \ltx@ifundefined{\string#1}{%
          }{%
            \global#1=#1%
            \@PackageInfoNoLine{zref-pageattr}{%
              \string#1 enabled%
            }%
          }%
        }{}%
      }%
      \ZREF@temp\pdfpageattr
      \ZREF@temp\pdfpagesattr
    \endgroup
  \fi
\fi
\let\ZREF@temp=N%
\ltx@IfUndefined{pdfpageattr}{%
  \@PackageInfoNoLine{zref-pageattr}{%
    \string\pdfpageattr\space is not available%
  }%
  \def\zref@pdfpageattr#1{}%
  \def\zref@pdfpageattr@used#1{}%
}{%
  \RequirePackage{zref-thepage}[2012/04/04]%
  \zref@newprop*{pdfpageattr}[]{\zref@hex{\the\pdfpageattr}}%
  \zref@addprop{thepage}{pdfpageattr}%
  \let\ZREF@temp=Y%
}
\ltx@IfUndefined{pdfpagesattr}{%
  \@PackageInfoNoLine{zref-pageattr}{%
    \string\pdfpagesattr\space is not available%
  }%
  \def\zref@pdfpagesattr{}%
  \def\zref@pdfpagesattr@used{}%
}{%
  \RequirePackage{zref-lastpage}[2012/04/04]%
  \zref@newprop*{pdfpagesattr}[]{\zref@hex{\the\pdfpagesattr}}%
  \zref@addprop{LastPage}{pdfpagesattr}%
  \let\ZREF@temp=Y%
}%
\ifx\ZREF@temp N%
  \expandafter\endinput
\fi
\RequirePackage{zref-abspage}[2012/04/04]
\RequirePackage{atveryend}[2010/03/24]
\RequirePackage{pdftexcmds}[2010/04/01]
\let\ZREF@temp=Y%
\ltx@IfUndefined{pdf@escapehex}{\let\ZREF@temp=N}{}
\ltx@IfUndefined{pdf@unescapehex}{\let\ZREF@temp=N}{}
\ifx\ZREF@temp N%
  \let\zref@hex\ltx@firstofone
  \let\zref@unhex\ltx@firstofone
\else
  \let\zref@hex\pdf@escapehex
  \let\zref@unhex\pdf@unescapehex
\fi
\ltx@newif\ifZREF@pa@list
\ZREF@IfDefinable\zlistpageattr\def{%
  {\ZREF@pa@listtrue}%
}
\def\ZREF@pa@AfterLastShipout{%
  \ifZREF@pa@list
    \edef\ZREF@page@max{\the\value{abspage}}%
    \ltx@ifundefined{ZREF@org@testdef}{%
      \let\ZREF@org@testdef\@testdef
      \def\@testdef##1##2##3{%
        \ZREF@org@testdef{##1}{##2}{##3}%
        \def\ZREF@temp{##1}%
        \ifx\ZREF@temp\ZREF@RefPrefix
          \expandafter\xdef\csname##1@##2\endcsname{##3}%
        \fi
      }%
    }{}%
    \AtVeryEndDocument{\ZREF@pa@AtVeryEnd}%
  \fi
}
\ltx@IfUndefined{pdfpageattr}{%
  \def\ZREF@pa@AtVeryEnd{}%
}{%
  \def\ZREF@pa@AtVeryEnd{%
    \begingroup
      \toks@{List of \ltx@backslashchar pdfpageattr:\MessageBreak}%
      \count@=1 %
      \ZREF@pa@ListPage
      \edef\x{\endgroup
        \noexpand\@PackageInfoNoLine{zref-pageattr}{%
          \the\toks@
        }%
      }%
    \x
  }%
\def\zref@pageattr#1{%
  \zref@unhex{%
    \zref@extract{thepage\ZREF@number{#1}}{pdfpageattr}%
  }%
}
\ZREF@Robust\def\zref@pageattr@used#1{%
  \zref@refused{thepage\ZREF@number{#1}}%
}
  \def\ZREF@pa@ListPage{%
    \edef\x{%
      \toks@={%
        \the\toks@
        Page \the\count@:%
        \noexpand\MessageBreak
        \zref@ifrefundefined{thepage\the\count@}{}{%
          <<\zref@pdfpageattr\count@>>%
          \noexpand\MessageBreak
        }%
      }%
    }\x
    \ifnum\ZREF@page@max>\count@
      \advance\count@ by\ltx@one
    \else
      \expandafter\ltx@gobble
    \fi
    \ZREF@pa@ListPage
  }%
}
\ltx@IfUndefined{pdfpagesattr}{%
}{%
  \def\zref@pdfpagesattr{%
    \zref@unhex{%
      \zref@extract{LastPage}{pdfpagesattr}%
    }%
  }%
  \ZREF@Robust\def\zref@pdfpagesattr@used{%
    \zref@refused{LastPage}%
  }%
  \ltx@LocalAppendToMacro\ZREF@pa@AtVeryEnd{%
    \@PackageInfoNoLine{zref-pageattr}{%
      \ltx@backslashchar pdfpagesattr:\MessageBreak
      <<\zref@pdfpagesattr>>%
      \MessageBreak
    }%
  }%
}
\AfterLastShipout{%
  \ZREF@pa@AfterLastShipout
}
\endinput
%%
%% End of file `zref-pageattr.sty'.
