summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty')
-rw-r--r--Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty111
1 files changed, 104 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty b/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
index 993edd686e5..62e976e64ec 100644
--- a/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
+++ b/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
@@ -87,7 +87,7 @@
\fi
\expandafter\x\csname ver@pdftexcmds.sty\endcsname
\ProvidesPackage{pdftexcmds}%
- [2009/04/10 v0.4 LuaTeX support for pdfTeX utility functions (HO)]
+ [2009/09/22 v0.5 LuaTeX support for pdfTeX utility functions (HO)]
\begingroup
\catcode123 1 % {
\catcode125 2 % }
@@ -131,6 +131,11 @@
\TMP@EnsureCode{95}{12}% _ (other)
\TMP@EnsureCode{96}{12}% `
\TMP@EnsureCode{126}{12}% ~ (other)
+\edef\pdftexcmds@AtEnd{%
+ \pdftexcmds@AtEnd
+ \escapechar=\number\escapechar\relax
+}
+\escapechar=92 %
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input infwarerr.sty\relax
@@ -141,7 +146,7 @@
\fi
\ifluatex
\else
- \@PackageInfo{pdftexcmds}{LuaTeX not detected}%
+ \@PackageInfoNoLine{pdftexcmds}{LuaTeX not detected}%
\def\pdftexcmds@nopdftex{%
\@PackageInfoNoLine{pdftexcmds}{pdfTeX >= 1.30 not detected}%
\let\pdftexcmds@nopdftex\relax
@@ -193,13 +198,105 @@
\def\pdf@system#{%
\immediate\write18%
}%
- \pdftexcmds@AtEnd
- \expandafter\endinput
\fi
-\ifnum\luatexversion<36 %
- \def\pdftexcmds@directlua{\directlua0 }%
+\ifluatex
+ \ifnum\luatexversion<36 %
+ \def\pdftexcmds@directlua{\directlua0 }%
+ \else
+ \let\pdftexcmds@directlua\directlua
+ \fi
+ \begingroup
+ \newlinechar=10 %
+ \endlinechar=\newlinechar
+ \pdftexcmds@directlua{%
+ if tex.enableprimitives then
+ tex.enableprimitives('pdf@', {'primitive', 'ifprimitive'})
+ end
+ }%
+ \endgroup %
+\fi
+\def\pdftexcmds@strip@prefix#1>{}
+\def\pdftexcmds@temp#1#2#3{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdf@#1\endcsname\relax
+ \begingroup
+ \def\x{#3}%
+ \edef\x{\expandafter\pdftexcmds@strip@prefix\meaning\x}%
+ \escapechar=-1 %
+ \edef\y{\expandafter\meaning\csname#2\endcsname}%
+ \expandafter\endgroup
+ \ifx\x\y
+ \expandafter\let\csname pdf@#1\expandafter\endcsname
+ \csname #2\endcsname
+ \fi
+ \fi
+}
+\pdftexcmds@temp{primitive}{pdfprimitive}{pdfprimitive}% pdfTeX, LuaTeX
+\pdftexcmds@temp{primitive}{primitive}{primitive}% XeTeX
+\pdftexcmds@temp{primitive}{luatexprimitive}{pdfprimitive}% LuaTeX
+\pdftexcmds@temp{primitive}{luatexpdfprimitive}{pdfprimitive}% LuaTeX
+\pdftexcmds@temp{ifprimitive}{ifpdfprimitive}{ifpdfprimitive}% pdfTeX, LuaTeX
+\pdftexcmds@temp{ifprimitive}{ifprimitive}{ifprimitive}% XeTeX
+\pdftexcmds@temp{ifprimitive}{luatexifprimitive}{ifpdfprimitive}% LuaTeX
+\pdftexcmds@temp{ifprimitive}{luatexifpdfprimitive}{ifpdfprimitive}% LuaTeX
+\begingroup
+ \expandafter\ifx\csname pdf@primitive\endcsname\relax
+ \else
+ \expandafter\ifx\csname pdftexversion\endcsname\relax
+ \else
+ \ifnum\pdftexversion=140 %
+ \expandafter\ifx\csname pdftexrevision\endcsname\relax
+ \else
+ \ifnum\pdftexrevision<4 %
+ \endgroup
+ \let\pdf@primitive\@undefined
+ \@PackageInfoNoLine{pdftexcmds}{%
+ \string\pdf@primitive disabled, because\MessageBreak
+ \string\pdfprimitive\space is broken until pdfTeX 1.40.4%
+ }%
+ \begingroup
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+\endgroup
+\begingroup
+ \@PackageInfoNoLine{pdftexcmds}{%
+ \string\pdf@primitive\space is %
+ \expandafter\ifx\csname pdf@primitive\endcsname\relax not \fi
+ available%
+ }%
+ \@PackageInfoNoLine{pdftexcmds}{%
+ \string\pdf@ifprimitive\space is %
+ \expandafter\ifx\csname pdf@ifprimitive\endcsname\relax not \fi
+ available%
+ }%
+\endgroup
+\def\pdftexcmds@temp#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdf@#1\endcsname\relax
+ \begingroup
+ \escapechar=-1 %
+ \edef\x{\expandafter\meaning\csname#1\endcsname}%
+ \def\y{#1}%
+ \def\z##1->{}%
+ \edef\y{\expandafter\z\meaning\y}%
+ \expandafter\endgroup
+ \ifx\x\y
+ \expandafter\def\csname pdf@#1\expandafter\endcsname
+ \expandafter{%
+ \csname#1\endcsname
+ }%
+ \fi
+ \fi
+}%
+\pdftexcmds@temp{shellescape}%
+\pdftexcmds@temp{strcmp}%
+\ifluatex
\else
- \let\pdftexcmds@directlua\directlua
+ \pdftexcmds@AtEnd
+ \expandafter\endinput
\fi
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax