| 1 |
\input ptb-utils |
| 2 |
|
| 3 |
\_checkloaded{hooks} |
| 4 |
|
| 5 |
\input pdfData/ptb-arrays |
| 6 |
|
| 7 |
\def\createhook#1{% |
| 8 |
\_xp\def\csname hook@#1\endcsname{} |
| 9 |
} |
| 10 |
|
| 11 |
\def\appendtohook#1#2{% |
| 12 |
\def\_temp{\_xp\def\csname hook@#1\endcsname}% |
| 13 |
\_xp\_xp\_xp\_temp\_xp\_xp\_xp{\csname hook@#1\endcsname#2} |
| 14 |
} |
| 15 |
|
| 16 |
\def\prependtohook#1#2{% |
| 17 |
\def\_temp{\_xp\def\csname hook@#1\endcsname}% |
| 18 |
\def\_tempA{#2}% |
| 19 |
\_xp\_xp\_xp\_xp\_xp\_xp\_xp\_temp\_xp\_xp\_xp\_xp\_xp\_xp\_xp{\_xp\_xp\_xp\_tempA\_xp\_xp\_xp\csname hook@#1\endcsname}% |
| 20 |
} |
| 21 |
|
| 22 |
\def\callhook#1{% |
| 23 |
\csname hook@#1\endcsname% |
| 24 |
} |
| 25 |
|
| 26 |
\createhook{end} |
| 27 |
|
| 28 |
\def\_writedata#1{\immediate\write\_PTBwrite{\gdef\noexpand#1{#1}}} |
| 29 |
|
| 30 |
\createarray{document data} |
| 31 |
\def\docdata#1{\appendarray{document data}{#1}} |
| 32 |
|
| 33 |
\appendtohook{end}{% |
| 34 |
\immediate\openout\_PTBwrite{\jobname .data}% |
| 35 |
\let\_arr_index=\_writedata% |
| 36 |
\executearray{document data}% |
| 37 |
} |
| 38 |
|
| 39 |
\def\bye{\par\callhook{end}\par\vfill\supereject\end} |
| 40 |
|