Debian Codegraph @

texmf-dist/tex/generic/catchfile/catchfile.sty

raw
1 %%
2 %% This is file `catchfile.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% catchfile.dtx (with options: `package')
8 %%
9 %% This is a generated file.
10 %%
11 %% Project: catchfile
12 %% Version: 2019/12/09 v1.8
13 %%
14 %% Copyright (C)
15 %% 2007, 2010, 2011 Heiko Oberdiek
16 %% 2016-2019 Oberdiek Package Support Group
17 %%
18 %% This work may be distributed and/or modified under the
19 %% conditions of the LaTeX Project Public License, either
20 %% version 1.3c of this license or (at your option) any later
21 %% version. This version of this license is in
22 %% https://www.latex-project.org/lppl/lppl-1-3c.txt
23 %% and the latest version of this license is in
24 %% https://www.latex-project.org/lppl.txt
25 %% and version 1.3 or later is part of all distributions of
26 %% LaTeX version 2005/12/01 or later.
27 %%
28 %% This work has the LPPL maintenance status "maintained".
29 %%
30 %% The Current Maintainers of this work are
31 %% Heiko Oberdiek and the Oberdiek Package Support Group
32 %% https://github.com/ho-tex/catchfile/issues
33 %%
34 %%
35 %% The Base Interpreter refers to any `TeX-Format',
36 %% because some files are installed in TDS:tex/generic//.
37 %%
38 %% This work consists of the main source file catchfile.dtx
39 %% and the derived files
40 %% catchfile.sty, catchfile.pdf, catchfile.ins, catchfile.drv,
41 %% catchfile-test1.tex, catchfile-test2.tex,
42 %% catchfile-test3.tex.
43 %%
44 \begingroup\catcode61\catcode48\catcode32=10\relax%
45 \catcode13=5 % ^^M
46 \endlinechar=13 %
47 \catcode35=6 % #
48 \catcode39=12 % '
49 \catcode44=12 % ,
50 \catcode45=12 % -
51 \catcode46=12 % .
52 \catcode58=12 % :
53 \catcode64=11 % @
54 \catcode123=1 % {
55 \catcode125=2 % }
56 \expandafter\let\expandafter\x\csname [email protected]\endcsname
57 \ifx\x\relax % plain-TeX, first loading
58 \else
59 \def\empty{}%
60 \ifx\x\empty % LaTeX, first loading,
61 % variable is initialized, but \ProvidesPackage not yet seen
62 \else
63 \expandafter\ifx\csname PackageInfo\endcsname\relax
64 \def\x#1#2{%
65 \immediate\write-1{Package #1 Info: #2.}%
66 }%
67 \else
68 \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
69 \fi
70 \x{catchfile}{The package is already loaded}%
71 \aftergroup\endinput
72 \fi
73 \fi
74 \endgroup%
75 \begingroup\catcode61\catcode48\catcode32=10\relax%
76 \catcode13=5 % ^^M
77 \endlinechar=13 %
78 \catcode35=6 % #
79 \catcode39=12 % '
80 \catcode40=12 % (
81 \catcode41=12 % )
82 \catcode44=12 % ,
83 \catcode45=12 % -
84 \catcode46=12 % .
85 \catcode47=12 % /
86 \catcode58=12 % :
87 \catcode64=11 % @
88 \catcode91=12 % [
89 \catcode93=12 % ]
90 \catcode123=1 % {
91 \catcode125=2 % }
92 \expandafter\ifx\csname ProvidesPackage\endcsname\relax
93 \def\x#1#2#3[#4]{\endgroup
94 \immediate\write-1{Package: #3 #4}%
95 \xdef#1{#4}%
96 }%
97 \else
98 \def\x#1#2[#3]{\endgroup
99 #2[{#3}]%
100 \ifx#1\@undefined
101 \xdef#1{#3}%
102 \fi
103 \ifx#1\relax
104 \xdef#1{#3}%
105 \fi
106 }%
107 \fi
108 \expandafter\x\csname [email protected]\endcsname
109 \ProvidesPackage{catchfile}%
110 [2019/12/09 v1.8 Catch the contents of a file (HO)]%
111 \begingroup\catcode61\catcode48\catcode32=10\relax%
112 \catcode13=5 % ^^M
113 \endlinechar=13 %
114 \catcode123=1 % {
115 \catcode125=2 % }
116 \catcode64=11 % @
117 \def\x{\endgroup
118 \expandafter\edef\csname CatchFile@AtEnd\endcsname{%
119 \endlinechar=\the\endlinechar\relax
120 \catcode13=\the\catcode13\relax
121 \catcode32=\the\catcode32\relax
122 \catcode35=\the\catcode35\relax
123 \catcode61=\the\catcode61\relax
124 \catcode64=\the\catcode64\relax
125 \catcode123=\the\catcode123\relax
126 \catcode125=\the\catcode125\relax
127 }%
128 }%
129 \x\catcode61\catcode48\catcode32=10\relax%
130 \catcode13=5 % ^^M
131 \endlinechar=13 %
132 \catcode35=6 % #
133 \catcode64=11 % @
134 \catcode123=1 % {
135 \catcode125=2 % }
136 \def\TMP@EnsureCode#1#2{%
137 \edef\CatchFile@AtEnd{%
138 \CatchFile@AtEnd
139 \catcode#1=\the\catcode#1\relax
140 }%
141 \catcode#1=#2\relax
142 }
143 \TMP@EnsureCode{39}{12}% '
144 \TMP@EnsureCode{44}{12}% ,
145 \TMP@EnsureCode{45}{12}% -
146 \TMP@EnsureCode{46}{12}% .
147 \TMP@EnsureCode{47}{12}% /
148 \TMP@EnsureCode{91}{12}% [
149 \TMP@EnsureCode{93}{12}% ]
150 \TMP@EnsureCode{96}{12}% `
151 \edef\CatchFile@AtEnd{\CatchFile@AtEnd\noexpand\endinput}
152 \begingroup\expandafter\expandafter\expandafter\endgroup
153 \expandafter\ifx\csname RequirePackage\endcsname\relax
154 \input infwarerr.sty\relax
155 \input ltxcmds.sty\relax
156 \else
157 \RequirePackage{infwarerr}[2007/09/09]%
158 \RequirePackage{ltxcmds}[2010/03/09]%
159 \fi
160 \begingroup
161 \escapechar=92\relax
162 \edef\TestString{\string\everyeof}%
163 \edef\TestMeaning{\meaning\everyeof}%
164 \ifx\TestString\TestMeaning
165 \else
166 \@PackageError{catchfile}{%
167 Cannot find e-TeX's \string\everyeof,\MessageBreak
168 package loading is aborted%
169 }\@ehd
170 \endgroup
171 \expandafter\CatchFile@AtEnd
172 \fi%
173 \endgroup
174 \begingroup
175 \def\Check#1#2#3#4\endgroup{%
176 \edef\TestString{\string#1}%
177 \edef\TestMeaning{\meaning#2}%
178 \ifx\TestString\TestMeaning
179 \endgroup
180 \let\CatchFile@Primitive#2%
181 \def\CatchFile@Input{\CatchFile@Primitive#3}%
182 \else
183 #4\endgroup
184 \fi
185 }%
186 \Check\input\input{}%
187 \Check\input\@@input{}%
188 \Check\pdfprimitive\pdfprimitive\input
189 \@PackageError{%
190 Cannot find primitive \string\input,\MessageBreak
191 package loading is aborted%
192 }\@ehd
193 \csname endgroup\endcsname
194 \CatchFile@AtEnd%
195 \endgroup
196 \begingroup\expandafter\expandafter\expandafter\endgroup
197 \expandafter\ifx\csname IfFileExists\endcsname\relax
198 \input pdftexcmds.sty\relax
199 \begingroup\expandafter\expandafter\expandafter\endgroup
200 \expandafter\ifx\csname pdf@filesize\endcsname\relax
201 \def\CatchFile@CheckFileExists#1{%
202 \expandafter\ifx\csname @inputcheck\endcsname\relax
203 \csname newread\endcsname\@inputcheck
204 \fi
205 \openin\@inputcheck#1\relax
206 \expandafter\closein\expandafter\@inputcheck
207 \ifeof\@inputcheck
208 \let\CatchFile@File\relax
209 \else
210 \def\CatchFile@File{#1}%
211 \fi
212 }%
213 \else
214 \def\CatchFile@CheckFileExists#1{%
215 \expandafter\expandafter\expandafter\ifx
216 \expandafter\expandafter\expandafter\relax\pdf@filesize{#1}\relax
217 \let\CatchFile@File\relax
218 \else
219 \def\CatchFile@File{#1}%
220 \fi
221 }%
222 \fi
223 \else
224 \def\CatchFile@CheckFileExists#1{%
225 \IfFileExists{#1}{%
226 \expandafter\CatchFile@DefFile\@filef@und\@nil
227 \begingroup\expandafter\expandafter\expandafter\endgroup
228 \expandafter\ifx\csname @addtofilelist\endcsname\relax
229 \else
230 \@addtofilelist\CatchFile@File
231 \fi
232 }{%
233 \let\CatchFile@File\relax
234 }%
235 }%
236 \def\CatchFile@DefFile#1 \@nil{%
237 \def\CatchFile@File{#1}%
238 }%
239 \fi
240 \def\CatchFile@NotFound#1#2{%
241 \def#1{}%
242 \@PackageError{catchfile}{%
243 File `#2' not found%
244 }\@ehc
245 }
246 \ltx@IfUndefined{RequirePackage}{%
247 \input etexcmds.sty\relax
248 }{%
249 \RequirePackage{etexcmds}[2010/01/28]%
250 }
251 \long\def\CatchFileEdef#1#2#3{%
252 \CatchFile@CheckFileExists{#2}%
253 \ifx\CatchFile@File\relax
254 \CatchFile@NotFound{#1}{#2}%
255 \else
256 \begingroup
257 \everyeof{\noexpand}%
258 #3%
259 \xdef\CatchFile@Contents{\CatchFile@Input\CatchFile@File\space}%
260 \endgroup
261 \let#1\CatchFile@Contents
262 \fi
263 }
264 \long\def\CatchFileDef#1#2#3{%
265 \CatchFile@CheckFileExists{#2}%
266 \ifx\CatchFile@File\relax
267 \CatchFile@NotFound{#1}{#2}%
268 \else
269 \begingroup
270 \everyeof\expandafter{%
271 \CatchFile@EOF
272 \expandafter\CatchFile@Finish
273 \noexpand
274 }%
275 \ltx@ifundefined{etex@unexpanded}{%
276 \expandafter\long\expandafter\def\expandafter\CatchFile@Do
277 \expandafter##\expandafter1\CatchFile@EOF{%
278 \toks\ltx@zero{##1}%
279 \xdef\CatchFile@gtemp{\the\toks\ltx@zero}%
280 \def\CatchFile@Finish{%
281 \endgroup
282 \let#1\CatchFile@gtemp
283 \global\let\CatchFile@gtemp\ltx@undefined
284 }%
285 }%
286 }{%
287 \expandafter\long\expandafter\def\expandafter\CatchFile@Do
288 \expandafter##\expandafter1\CatchFile@EOF{%
289 \edef\CatchFile@Finish{%
290 \endgroup
291 \etex@unexpanded{%
292 \edef#1{\etex@unexpanded{##1}}%
293 }%
294 }%
295 }%
296 }%
297 #3\relax
298 \expandafter\expandafter\expandafter\CatchFile@Do
299 \CatchFile@Input\CatchFile@File\relax
300 \fi
301 }
302 \begingroup
303 \lccode65=64 % lowercase('A') = '@'
304 \lccode66=64 % lowercase('B') = '@'
305 \catcode65=8 % catcode('A') = subscript
306 \catcode66=3 % catcode('B') = math shift
307 \lowercase{\endgroup
308 \def\CatchFile@EOF{AB}%
309 }
310 \CatchFile@AtEnd%
311 %% \section{Installation}
312 \endinput
313 %%
314 %% End of file `catchfile.sty'.