\catcode`\@ = 11
\newif \ifwithlinen@ \withlinen@true
\def \withlineno{ \withlinen@true} \def \withoutlineno{ \withlinen@false}
\def \n@mline{ \indent
\llap{\sevenrm \the\lineno~: \hskip .5em}}
\newcount \lineno \newcount \listingno \newcount \beginlineno \newcount \endlineno
\def \listingpath{ }
{\obeylines \global \def \temoin{^^M}}
\newbox \encadrbox
\def \initencadrbox{ \setbox \encadrbox =\hbox to \hsize{ \vrule height 9pt depth 3pt
\hfil
\vrule height 9pt depth 3pt}
\ht \encadrbox = 0pt
\dp \encadrbox = 0pt
\wd \encadrbox = 0pt}
\newbox \box@ \newtoks \listingtoks
\newread \currentfile
\def \verb@tim{ \def \do##1{ \catcode`##1=12 } \def°{ \char23} \dospecials
\obeyspaces
\def \par{ \leavevmode
\endgraf} \obeylines
\eightpoint \tt}
\def \writelistingline#1{ \ifnum \lineno < \beginlineno \else \ifnum \lineno > \endlineno \else
#1
\fi
\fi}
\def \traite@ne{ \ifx \temoin \next \writelistingline{\next} \ifeof \currentfile \else \global \edef \rest@renum{\lineno \the \lineno}
\vss
\egroup \mark{\the \listingtoks}
\immediate \wlog{*************** \the \listingtoks ******** }
\vbox\bgroup \rest@renum \verb@tim
\fi
\else \writelistingline{\next} \fi}
\def \read@ne{ \read \currentfile to \next \global \advance \lineno by 1
\ifnum \listingno = 1 \traite@ne \else
\writelistingline{\next} \fi
\ifeof \currentfile \closein \currentfile \let \next \relax \else \let \next \read@ne \fi
\next}
\def \listing#1#2#3{ \partiallisting{#1}{#2}{#3}{0}{10000}}
\def \partiallisting#1#2#3#4#5{ \bigbreak \vskip 2\baselineskip
\penalty -200
\vskip -2\baselineskip
\listingno = #1
\beginlineno = #4
\endlineno = #5
\immediate \wlog{Beginning listing of \listingpath #2}
\initencadrbox
\begingroup \offinterlineskip
\listingtoks = {\tensl #3}
\everypar = { \hskip -\parindent
\copy \encadrbox
\strut
\ifwithlinen@
\n@mline
\else
\indent
\fi}
\parskip = 0pt
\lineno = 0
\ifwithlinen@
\parindent = 30pt
\else
\parindent = 20pt
\fi
\mark{\the\listingtoks}
\ifnum \listingno = 1 \vbox
\fi
\bgroup \setbox\box@ = \hbox{\tensl #3} \line{ \vrule height 0.4pt depth \dp\box@
\hrulefill
\quad \the \listingtoks \quad
\hrulefill
\vrule height 0.4pt depth \dp\box@}
\hbox to \hsize{ \vrule height 9pt depth 3pt
\hfil
\vrule height 9pt depth 3pt}
\verb@tim
\openin \currentfile = \listingpath #2 \read@ne \endgraf
\nobreak
\hbox to \hsize{ \vrule height 9pt depth 0pt
\hfil
\vrule height 9pt depth 0pt}
\hrule \egroup \endgroup \mark{} \immediate \wlog{End listing of #2}
\bigbreak}
\output = { \expandafter \listingchek \botmark \end} \def \listingchek#1\end{%
\def \next{#1} \ifx \next \empty \else \setbox255 = \vbox to \vsize{ \unvbox255 \nointerlineskip \line{\copy \encadrbox \hfil \strut}
\nointerlineskip
\hbox to \hsize{ \vsize = 0pt
\dotfill}}
\line{ \vrule height 0pt depth 2.5pt
\dotfill \quad \sl \next \hskip 1em (suite)\quad \dotfill \vrule height 0pt depth 2.5pt}
\line{\copy \encadrbox \strut \hfill} \fi
\plainoutput} \catcode`\@ = 12
\endinput

—
Syracuse — Dernière modification : 22 octobre 2002 (0.06s - 3820708 - 2 décembre 2008)