summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-06-17 23:22:07 +0000
committerKarl Berry <karl@freefriends.org>2007-06-17 23:22:07 +0000
commitf0c1f4cdb9fad83f293fd91d194538425f9f7633 (patch)
tree1bc04aef1c35fe6e07fb532c1fefbe3ad1b37be8 /Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
parentcc91b833be17617d7383dfa801a01ef5c95c3752 (diff)
oberdiek update (15jun07)
git-svn-id: svn://tug.org/texlive/trunk@4458 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/oberdiek/catchfile.sty')
-rw-r--r--Master/texmf-dist/tex/generic/oberdiek/catchfile.sty232
1 files changed, 232 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty b/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
new file mode 100644
index 00000000000..a71b8678285
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
@@ -0,0 +1,232 @@
+%%
+%% This is file `catchfile.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% catchfile.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de>
+%%
+%% 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
+%% 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 catchfile.dtx
+%% and the derived files
+%% catchfile.sty, catchfile.pdf, catchfile.ins, catchfile.drv,
+%% catchfile-test1.tex, catchfile-test2.tex.
+%%
+\begingroup
+ \catcode44 12 % ,
+ \catcode45 12 % -
+ \catcode46 12 % .
+ \catcode58 12 % :
+ \catcode64 11 % @
+ \expandafter\let\expandafter\x\csname ver@catchfile.sty\endcsname
+ \ifcase 0%
+ \ifx\x\relax % plain
+ \else
+ \ifx\x\empty % LaTeX
+ \else
+ 1%
+ \fi
+ \fi
+ \else
+ \expandafter\ifx\csname PackageInfo\endcsname\relax
+ \def\x#1#2{%
+ \immediate\write-1{Package #1 Info: #2.}%
+ }%
+ \else
+ \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
+ \fi
+ \x{catchfile}{The package is already loaded}%
+ \endgroup
+ \expandafter\endinput
+ \fi
+\endgroup
+\begingroup
+ \catcode40 12 % (
+ \catcode41 12 % )
+ \catcode44 12 % ,
+ \catcode45 12 % -
+ \catcode46 12 % .
+ \catcode47 12 % /
+ \catcode58 12 % :
+ \catcode64 11 % @
+ \expandafter\ifx\csname ProvidesPackage\endcsname\relax
+ \def\x#1#2#3[#4]{\endgroup
+ \immediate\write-1{Package: #3 #4}%
+ \xdef#1{#4}%
+ }%
+ \else
+ \def\x#1#2[#3]{\endgroup
+ #2[{#3}]%
+ \ifx#1\relax
+ \xdef#1{#3}%
+ \fi
+ }%
+ \fi
+\expandafter\x\csname ver@catchfile.sty\endcsname
+\ProvidesPackage{catchfile}%
+ [2007/05/30 v1.0 Catches the contents of a file (HO)]
+\expandafter\edef\csname CatchFile@End\endcsname{%
+ \catcode44 \the\catcode44\relax % ,
+ \catcode45 \the\catcode45\relax % -
+ \catcode46 \the\catcode46\relax % .
+ \catcode61 \the\catcode61\relax % =
+ \catcode64 \the\catcode64\relax % @
+ \catcode96 \the\catcode96\relax % `
+ \noexpand\endinput
+}
+\catcode44 12 % ,
+\catcode45 12 % -
+\catcode46 12 % .
+\catcode61 12 % =
+\catcode64 11 % @
+\catcode96 12 % `
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+\else
+ \RequirePackage{infwarerr}%
+\fi
+\begingroup
+ \escapechar=92\relax
+ \edef\TestString{\string\everyeof}%
+ \edef\TestMeaning{\meaning\everyeof}%
+ \ifx\TestString\TestMeaning
+ \else
+ \@PackageErrorNoLine{catchfile}{%
+ Cannot find e-TeX's \string\everyeof,\MessageBreak
+ package loading is aborted%
+ }\@ehd
+ \endgroup
+ \expandafter\CatchFile@End
+ \fi
+\endgroup
+\begingroup
+ \def\Check#1#2#3#4\endgroup{%
+ \edef\TestString{\string#1}%
+ \edef\TestMeaning{\meaning#2}%
+ \ifx\TestString\TestMeaning
+ \endgroup
+ \let\CatchFile@Primitive#2%
+ \def\CatchFile@Input{\CatchFile@Primitive#3}%
+ \else
+ #4\endgroup
+ \fi
+ }%
+ \Check\input\input{}%
+ \Check\input\@@input{}%
+ \Check\pdfprimitive\pdfprimitive\input
+ \@PackageErrorNoLine{%
+ Cannot find primitive \string\input,\MessageBreak
+ package loading is aborted%
+ }\@ehd
+ \csname endgroup\endcsname
+ \CatchFile@End
+\endgroup
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname IfFileExists\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdffilesize\endcsname\relax
+ \def\CatchFile@CheckFileExists#1{%
+ \expandafter\ifx\csname @inputcheck\endcsname\relax
+ \csname newread\endcsname\@inputcheck
+ \fi
+ \openin\@inputcheck#1\relax
+ \ifeof\@inputcheck
+ \let\CatchFile@File\relax
+ \else
+ \closein\@inputcheck
+ \def\CatchFile@File{#1}%
+ \fi
+ }%
+ \else
+ \def\CatchFile@CheckFileExists#1{%
+ \expandafter\ifx\expandafter\\\pdffilesize{#1}\\%
+ \let\CatchFile@File\relax
+ \else
+ \def\CatchFile@File{#1}%
+ \fi
+ }%
+ \fi
+\else
+ \def\CatchFile@CheckFileExists#1{%
+ \IfFileExists{#1}{%
+ \expandafter\CatchFile@DefFile\@filef@und\@nil
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @addtofilelist\endcsname\relax
+ \else
+ \@addtofilelist\CatchFile@File
+ \fi
+ }{%
+ \let\CatchFile@File\relax
+ }%
+ }%
+ \def\CatchFile@DefFile#1 \@nil{%
+ \def\CatchFile@File{#1}%
+ }%
+\fi
+\def\CatchFile@NotFound#1#2{%
+ \def#1{}%
+ \@PackageError{catchfile}{%
+ File `#2' not found%
+ }\@ehc
+}
+\long\def\CatchFileEdef#1#2#3{%
+ \CatchFile@CheckFileExists{#2}%
+ \ifx\CatchFile@File\relax
+ \CatchFile@NotFound{#1}{#2}%
+ \else
+ \begingroup
+ \everyeof{\noexpand}%
+ #3%
+ \xdef\CatchFile@Contents{\CatchFile@Input\CatchFile@File\space}%
+ \endgroup
+ \let#1\CatchFile@Contents
+ \fi
+}
+\long\def\CatchFileDef#1#2#3{%
+ \CatchFile@CheckFileExists{#2}%
+ \ifx\CatchFile@File\relax
+ \CatchFile@NotFound{#1}{#2}%
+ \else
+ \begingroup
+ \everyeof\expandafter{%
+ \CatchFile@EOF
+ \noexpand
+ }%
+ \expandafter\long\expandafter\def\expandafter\CatchFile@Do
+ \expandafter##\expandafter1\CatchFile@EOF{%
+ \endgroup
+ \def#1{##1}%
+ }%
+ #3%
+ \expandafter\expandafter\expandafter\CatchFile@Do
+ \CatchFile@Input\CatchFile@File\relax
+ \fi
+}
+\begingroup
+ \lccode65=64 % lowercase('A') = '@'
+ \lccode66=64 % lowercase('B') = '@'
+ \catcode65=8 % catcode('A') = subscript
+ \catcode66=3 % catcode('B') = math shift
+\lowercase{\endgroup
+ \def\CatchFile@EOF{AB}%
+}
+\CatchFile@End
+\endinput
+%%
+%% End of file `catchfile.sty'.