<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%D \module
%D   [      file=x-fig-08,
%D        version=2002.06.27,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Resource Reporting,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \&amp; Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D TODO: make rlxtools callable from texexec (class), speeds up things.

%D Experimental module!
%D
%D \starttyping
%D &lt;rl:library&gt;
%D   &lt;rl:usage&gt;
%D     &lt;rl:type&gt;figure&lt;/rl:type&gt;
%D     &lt;rl:state&gt;found|missing&lt;/rl:state&gt;
%D     &lt;rl:name&gt;filename&lt;/rl:name&gt;
%D     &lt;rl:suffix&gt;filesuffix&lt;/rl:suffix&gt;
%D     &lt;rl:width&gt;width in pt&lt;/rl:width&gt;
%D     &lt;rl:height&gt;height in pt&lt;/rl:height&gt;
%D     &lt;rl:comment&gt;text&lt;/rl:comment&gt;
%D   &lt;/rl:usage&gt;
%D &lt;/rl:library&gt;
%D \stoptyping

\doifnotmode{\systemmodeprefix\v!first}{\endinput}

\unprotect

\def\XMLrlprefix{rl:}

\newwrite\XMLrllog

\def\openXMLresourcelog
  {\immediate\openout\XMLrllog\jobname.rlg\relax
   \immediate\write\XMLrllog{\XMLbanner{standalone='yes'}}%
   \immediate\write\XMLrllog{\writtenXMLstart{\XMLrlprefix library}}}

\def\closeXMLresourcelog
  {\immediate\write\XMLrllog{\writtenXMLend{\XMLrlprefix library}}%
   \immediate\closeout\XMLrllog}

\let\figurefilelabel     \empty
\let\figurefileoriginal  \empty
\let\figurefilefile      \empty
\let\figurefilepath      \empty
\let\figurefileconversion\empty
\let\figurefileprefix    \empty

\def\XMLfeedbackresource#1#2%
  {\begingroup
   \convertcommand\currentresourcecomment\to\currentresourcecomment
   \doifnothing\figurefilefile{\edef\figurefilefile{\figurefilename.\figurefiletype}}%
   \immediate\write\XMLrllog
     {\writtenXMLelement{\XMLrlprefix usage}%
        {\writtenXMLelement{\XMLrlprefix         type}{#2}% 'figure' not the type in \extenalfigure
         \writtenXMLelement{\XMLrlprefix        state}{#1}% 'missing' 'found' etc
         \ifx\figurefilelabel\empty
           \ifx\figurelabel\s!dummy \else % otherwise label equals filename
             \writtenXMLelementcs{\XMLrlprefix  label}\figurelabel
           \fi
           \writtenXMLelementcs{\XMLrlprefix     file}\figurefilefile % complete name
           \writtenXMLelementcs{\XMLrlprefix     name}\figurefilename % no suffix
           \writtenXMLelementcs{\XMLrlprefix   suffix}\figurefiletype
         \else
           % \figurefilelabel is set in x-res-04 and since
           % we fetch from this base using the normal
           % \externalfigure macro, the label becomes the
           % name of the figurebase
           \writtenXMLelementcs{\XMLrlprefix     base}\figurefilename
           \writtenXMLelementcs{\XMLrlprefix    label}\figurefilelabel
           \writtenXMLelementcs{\XMLrlprefix     file}\figurefilefile
         \fi
         \writtenXMLelementcs{\XMLrlprefix       path}\figurefilepath
         \writtenXMLelementcs{\XMLrlprefix   original}\figurefileoriginal
         \writtenXMLelementcs{\XMLrlprefix conversion}\figurefileconversion
         \writtenXMLelementcs{\XMLrlprefix     prefix}\figurefileprefix
         \writtenXMLelementcs{\XMLrlprefix      cache}\figurefilecache
         \ifnum\figurefilepage&gt;\zerocount
           \writtenXMLelement{\XMLrlprefix       page}\figurefilepage
         \fi
         \writtenXMLelementcs{\XMLrlprefix    comment}\currentresourcecomment
         \ifconditional\externalfigureflush
           \writtenXMLelementcs{\XMLrlprefix    width}\figurewidth
           \writtenXMLelementcs{\XMLrlprefix   height}\figureheight
         \fi}}%
   \endgroup}

\def\XMLfeedbackexternalfigure
  {\doifmodeelse{*\v!figure}%
     {\XMLfeedbackresource{found}}%
     {\XMLfeedbackresource{\ifconditional\externalfigureflush missing\else registered\fi}}%
     {figure}}

\setvariables
  [rl:manipulate]
  [file=rlxtools.rlx]

% \startsetups[rl:manipulate]
%   \doiflocfileelse{\jobname.rlx}
%     {\installprogram{texmfstart rlxtools --manipulate kpse:\jobname.rlx \jobname.rlg}}
%     {\installprogram{texmfstart rlxtools --manipulate kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx} \jobname.rlg}}
% \stopsetups
%
% no longer need for \setups[rl:manipulate]

\ifx\nofconversionfigures\undefined \chardef\nofconversionfigures\plusone \fi

\appendtoks
  \ifcase\nofconversionfigures\else
    \doiflocfileelse{\jobname.rlx}
      {\installprogram{texmfstart rlxtools --manipulate kpse:\jobname.rlx \jobname.rlg}}
      {\installprogram{texmfstart rlxtools --manipulate kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx} \jobname.rlg}}%
  \fi
\to \everylastshipout

\appendtoks \openXMLresourcelog  \to \everystarttext
\appendtoks \closeXMLresourcelog \to \everystoptext

\let \feedbackexternalfigure \XMLfeedbackexternalfigure

\protect \endinput
</pre></body></html>