diff options
author | Karl Berry <karl@freefriends.org> | 2011-08-24 00:05:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-08-24 00:05:47 +0000 |
commit | be52161d176ec8b83077d89810997f588fa7e62e (patch) | |
tree | 770bd5d505dfea2672a27a55633e6c6f508c868e /Master/texmf-dist/tex/latex | |
parent | 3d1639d263d3315ae55d789b527ff12499ed8549 (diff) |
regstats (23aug11)
git-svn-id: svn://tug.org/texlive/trunk@23662 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/regstats/regstats.sty | 398 |
1 files changed, 218 insertions, 180 deletions
diff --git a/Master/texmf-dist/tex/latex/regstats/regstats.sty b/Master/texmf-dist/tex/latex/regstats/regstats.sty index f175cdb2258..7dcfb48e24f 100644 --- a/Master/texmf-dist/tex/latex/regstats/regstats.sty +++ b/Master/texmf-dist/tex/latex/regstats/regstats.sty @@ -9,7 +9,7 @@ %% This is a generated file. %% %% Project: regstats -%% Version: 2011/06/18 v1.0d +%% Version: 2011/08/23 v1.0f %% %% Copyright (C) 2011 by %% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de> @@ -38,8 +38,8 @@ %% regstats.sty, regstats.pdf, regstats.ins, regstats.drv, %% regstats-example.tex. %% -\NeedsTeXFormat{LaTeX2e}[2009/09/24] -\ProvidesPackage{regstats}[2011/06/18 v1.0d +\NeedsTeXFormat{LaTeX2e}[2011/06/27] +\ProvidesPackage{regstats}[2011/08/23 v1.0f Counting used registers (HMM)] %% Allows to count the number of used registers @@ -48,7 +48,7 @@ %% and compare these to the maximum available number of such registers. \RequirePackage{kvoptions}[2010/12/23]% v3.10 -\RequirePackage{atveryend}[2011/04/23]% v1.7 +\RequirePackage{atveryend}[2011/06/30]% v1.8 %% regstats may work with earlier versions of LaTeX and these %% packages, but this was not tested. Please consider updating @@ -82,6 +82,23 @@ \RequirePackage{intcalc}[2007/09/27]% v1.1 \fi +\@ifl@t@r\fmtversion{2011/06/27}% + {\@ifpackagelater{atveryend}{2011/06/29}% + {% 2011/06/30, v1.8, or even more recent + }{% older version + \PackageError{regstats}{Outdated atveryend package}% + {You use \fmtname \space <\fmtversion>, but only \MessageBreak% + `\csname ver@atveryend.\@currext\endcsname',\MessageBreak% + which is incompatibel with \fmtname \space <\fmtversion>.\MessageBreak% + Please update your atveryend package!\MessageBreak% + The regstats package now replaces \string\AtVeryVeryEnd \MessageBreak% + by \string\AtEndAfterFileList.\MessageBreak% + }% + \let\AtVeryVeryEnd\AtEndAfterFileList% + }% + }{% + } + \AtBeginDocument{% \newif\ifetex \begingroup\expandafter\expandafter\expandafter\endgroup @@ -102,189 +119,210 @@ but should give according messages.\MessageBreak% } \fi - } -\AtVeryEndDocument{% - \AtVeryVeryEnd{% - \def\regstats@lft{}% - \newcommand{\regstats@regstat}[5]{% - \setcounter{regstatscount}{#1} - \ifnum \value{regstatscount}=0 - \setcounter{regstatscount}{2} - \fi - \ifnum \value{regstatscount}>1 - \gdef\regstats@pl{#3} - \else - \gdef\regstats@pl{#2} - \fi - \ifetex\edef\regstats@max{#5}\else\edef\regstats@max{#4}\fi - \ifregstats@left - \setcounter{regstatscount}{\regstats@max} - \addtocounter{regstatscount}{-#1} - \ifnum \value{regstatscount}>0 - \edef\regstats@lft{, left: \arabic{regstatscount}} + \AtEndDocument{% + \BeforeClearDocument{% + \AfterLastShipout{% + \AtVeryEndDocument{% + \AtEndAfterFileList{% + \AtVeryVeryEnd{% + \def\regstats@lft{}% + \newcommand{\regstats@regstat}[5]{% + \setcounter{regstatscount}{#1} + \ifnum \value{regstatscount}=0 + \setcounter{regstatscount}{2} + \fi + \ifnum \value{regstatscount}>1 + \gdef\regstats@pl{#3} \else - \ifnum \value{regstatscount}=0 - \edef\regstats@lft{, left: \arabic{regstatscount} !!!} - \else% \value{regstatscount}<0 - \edef\regstats@lft{, left: \arabic{regstatscount} **********} + \gdef\regstats@pl{#2} + \fi + \ifetex\edef\regstats@max{#5}\else\edef\regstats@max{#4}\fi + \ifregstats@left + \setcounter{regstatscount}{\regstats@max} + \addtocounter{regstatscount}{-#1} + \ifnum \value{regstatscount}>0 + \edef\regstats@lft{, left: \arabic{regstatscount}} + \else + \ifnum \value{regstatscount}=0 + \edef\regstats@lft{, left: \arabic{regstatscount} !!!} + \else% \value{regstatscount}<0 + \edef\regstats@lft{, left: \arabic{regstatscount} **********} + \fi \fi \fi - \fi - } - \newcounter{regstatscount} - \edef\regstats@counter{\the\allocationnumber} - \ifregstats@proof - \PackageWarning{regstats}{% - Package regstats loaded with option 'proof'.\MessageBreak% - This package itself will now use\MessageBreak% - one of each register for testing!% - }% - \def\regstats@proof{1} - \edef\regstats@test{\the\count10} - \ifx\regstats@counter\regstats@test - \else \message{Discrepancy when counting count registers.^^J} - \def\regstats@proof{0} - \fi - \newdimen{\regstatsdimen} - \edef\regstats@dimen{\the\allocationnumber} - \edef\regstats@test{\the\count11} - \ifx\regstats@dimen\regstats@test - \else \message{Discrepancy when counting dimen registers.^^J} - \def\regstats@proof{0} - \fi - \newskip\regstatsskip - \edef\regstats@skip{\the\allocationnumber} - \edef\regstats@test{\the\count12} - \ifx\regstats@skip\regstats@test - \else \message{Discrepancy when counting skip registers.^^J} - \def\regstats@proof{0} - \fi - \newmuskip\regstatsmuskip - \edef\regstats@muskip{\the\allocationnumber} - \edef\regstats@test{\the\count13} - \ifx\regstats@muskip\regstats@test - \else \message{Discrepancy when counting muskip registers.^^J} - \def\regstats@proof{0} - \fi - \newbox\regstatsbox - \edef\regstats@box{\the\allocationnumber} - \edef\regstats@test{\the\count14} - \ifx\regstats@box\regstats@test - \else \message{Discrepancy when counting box registers.^^J} - \def\regstats@proof{0} - \fi - \newtoks\regstatstoks - \edef\regstats@toks{\the\allocationnumber} - \edef\regstats@test{\the\count15} - \ifx\regstats@toks\regstats@test - \else \message{Discrepancy when counting toks registers.^^J} - \def\regstats@proof{0} - \fi - \newread\regstatsread - \edef\regstats@read{\the\allocationnumber} - \edef\regstats@test{\the\count16} - \ifx\regstats@read\regstats@test - \else \message{Discrepancy when counting read registers.^^J} - \def\regstats@proof{0} - \fi - \newwrite\regstatswrite - \edef\regstats@write{\the\allocationnumber} - \edef\regstats@test{\the\count17} - \ifx\regstats@write\regstats@test - \else \message{Discrepancy when counting write registers.^^J} - \def\regstats@proof{0} - \fi - \newfam\regstatsfam - \edef\regstats@fam{\the\allocationnumber} - \edef\regstats@test{\the\count18} - \ifx\regstats@fam\regstats@test - \else \message{Discrepancy when counting fam registers.^^J} - \def\regstats@proof{0} - \fi - \newlanguage\regstatslanguage - \edef\regstats@language{\the\allocationnumber} - \edef\regstats@test{\the\count19} - \ifx\regstats@language\regstats@test - \else \message{Discrepancy when counting language registers.^^J} - \def\regstats@proof{0} - \fi - \newinsert\regstatsinsert - \edef\regstats@insert{\the\allocationnumber} - \edef\regstats@test{\the\count20} - \ifx\regstats@insert\regstats@test - \else \message{Discrepancy when counting insert registers.^^J} - \def\regstats@proof{0} - \fi - \edef\regstats@test{0} - \ifx\regstats@proof\regstats@test - \message{Regstats test for register numbers failed.^^J} - \message{Therefore option 'proof' is necessary to get the % - right numbers.^^J} - \fi - \else - \edef\regstats@dimen{\the\count11} - \edef\regstats@skip{\the\count12} - \edef\regstats@muskip{\the\count13} - \edef\regstats@box{\the\count14} - \edef\regstats@toks{\the\count15} - \edef\regstats@read{\the\count16} - \edef\regstats@write{\the\count17} - \edef\regstats@fam{\the\count18} - \edef\regstats@language{\the\count19} - \edef\regstats@insert{\the\count20} - \fi - \setcounter{regstatscount}{233} - \addtocounter{regstatscount}{-\regstats@insert} - \addtocounter{regstatscount}{+1} - \edef\regstats@insert{\arabic{regstatscount}} - \message{^^J} - \message{Here is how much of TeX's registers you used^^J}% - \message{\space (numbers of available registers are estimated!):^^J}% - \regstats@regstat{\regstats@counter}{}{s}{233}{32767} - \message{ \regstats@counter\space counter register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@dimen}{}{s}{233}{32767} - \message{ \regstats@dimen\space dimen register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@skip}{}{s}{233}{32767} - \message{ \regstats@skip\space skip register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@muskip}{}{s}{255}{32767} - \message{ \regstats@muskip\space muskip register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@box}{}{s}{233}{32767} - \message{ \regstats@box\space box register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@toks}{}{s}{255}{32767} - \message{ \regstats@toks\space toks register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@read}{}{s}{15}{15} - \message{ \regstats@read\space input stream\regstats@pl\space (read) out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@write}{}{s}{15}{15} - \message{ \regstats@write\space output stream\regstats@pl\space (write) out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@fam}{y}{ies}{15}{15} - \message{ \regstats@fam\space math famil\regstats@pl\space (fam) out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@language}{}{s}{255}{255} - \message{ \regstats@language\space language code\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \regstats@regstat{\regstats@insert}{}{s}{101}{124} - \message{ \regstats@insert\space insertion\regstats@pl\space out of \regstats@max \regstats@lft ^^J} - \ifregstats@timer - \message{^^J} - \setcounter{regstatscount}{\the\pdfelapsedtime} - \edef\regstatselapsedtime{\arabic{regstatscount}} - \divide \value{regstatscount} by 65536% scaledseconds -> seconds - \edef\regstatsseconds{\arabic{regstatscount}} - \ifnum \value{regstatscount} > 59 - \edef\regstatsseconds{\intcalcMod{\value{regstatscount}}{60}} - \divide \value{regstatscount} by 60% seconds -> minutes + } + \newcounter{regstatscount} + \edef\regstats@counter{\the\allocationnumber} + \ifregstats@proof + \PackageWarning{regstats}{% + Package regstats loaded with option 'proof'.\MessageBreak% + This package itself will now use\MessageBreak% + one of each register for testing!% + }% + \def\regstats@proof{1} + \edef\regstats@test{\the\count10} + \ifx\regstats@counter\regstats@test + \else + \message{Discrepancy when counting count registers.^^J} + \def\regstats@proof{0} + \fi + \newdimen{\regstatsdimen} + \edef\regstats@dimen{\the\allocationnumber} + \edef\regstats@test{\the\count11} + \ifx\regstats@dimen\regstats@test + \else + \message{Discrepancy when counting dimen registers.^^J} + \def\regstats@proof{0} + \fi + \newskip\regstatsskip + \edef\regstats@skip{\the\allocationnumber} + \edef\regstats@test{\the\count12} + \ifx\regstats@skip\regstats@test + \else + \message{Discrepancy when counting skip registers.^^J} + \def\regstats@proof{0} + \fi + \newmuskip\regstatsmuskip + \edef\regstats@muskip{\the\allocationnumber} + \edef\regstats@test{\the\count13} + \ifx\regstats@muskip\regstats@test + \else + \message{Discrepancy when counting muskip registers.^^J} + \def\regstats@proof{0} + \fi + \newbox\regstatsbox + \edef\regstats@box{\the\allocationnumber} + \edef\regstats@test{\the\count14} + \ifx\regstats@box\regstats@test + \else + \message{Discrepancy when counting box registers.^^J} + \def\regstats@proof{0} + \fi + \newtoks\regstatstoks + \edef\regstats@toks{\the\allocationnumber} + \edef\regstats@test{\the\count15} + \ifx\regstats@toks\regstats@test + \else + \message{Discrepancy when counting toks registers.^^J} + \def\regstats@proof{0} + \fi + \newread\regstatsread + \edef\regstats@read{\the\allocationnumber} + \edef\regstats@test{\the\count16} + \ifx\regstats@read\regstats@test + \else + \message{Discrepancy when counting read registers.^^J} + \def\regstats@proof{0} + \fi + \newwrite\regstatswrite + \edef\regstats@write{\the\allocationnumber} + \edef\regstats@test{\the\count17} + \ifx\regstats@write\regstats@test + \else + \message{Discrepancy when counting write registers.^^J} + \def\regstats@proof{0} + \fi + \newfam\regstatsfam + \edef\regstats@fam{\the\allocationnumber} + \edef\regstats@test{\the\count18} + \ifx\regstats@fam\regstats@test + \else + \message{Discrepancy when counting fam registers.^^J} + \def\regstats@proof{0} + \fi + \newlanguage\regstatslanguage + \edef\regstats@language{\the\allocationnumber} + \edef\regstats@test{\the\count19} + \ifx\regstats@language\regstats@test + \else + \message{Discrepancy when counting language registers.^^J} + \def\regstats@proof{0} + \fi + \newinsert\regstatsinsert + \edef\regstats@insert{\the\allocationnumber} + \edef\regstats@test{\the\count20} + \ifx\regstats@insert\regstats@test + \else + \message{Discrepancy when counting insert registers.^^J} + \def\regstats@proof{0} + \fi + \edef\regstats@test{0} + \ifx\regstats@proof\regstats@test + \message{Regstats test for register numbers failed.^^J} + \message{Therefore option 'proof' is necessary to get the % + right numbers.^^J} + \fi \else - \setcounter{regstatscount}{0}% minutes = 0 + \edef\regstats@dimen{\the\count11} + \edef\regstats@skip{\the\count12} + \edef\regstats@muskip{\the\count13} + \edef\regstats@box{\the\count14} + \edef\regstats@toks{\the\count15} + \edef\regstats@read{\the\count16} + \edef\regstats@write{\the\count17} + \edef\regstats@fam{\the\count18} + \edef\regstats@language{\the\count19} + \edef\regstats@insert{\the\count20} \fi - \ifnum \regstatsseconds < 10 - \message{Time elapsed: about \arabic{regstatscount}:0\regstatsseconds% - \space (m:ss; \regstatselapsedtime /65536 s).^^J} - \else - \message{Time elapsed: about \arabic{regstatscount}:\regstatsseconds % - \space (m:ss; \regstatselapsedtime /65536 s).^^J} + \setcounter{regstatscount}{233} + \addtocounter{regstatscount}{-\regstats@insert} + \addtocounter{regstatscount}{+1} + \edef\regstats@insert{\arabic{regstatscount}} + \message{^^J} + \message{Here is how much of TeX's registers you used^^J}% + \message{\space (numbers of available registers are estimated!):^^J}% + \regstats@regstat{\regstats@counter}{}{s}{233}{32767} + \message{ \regstats@counter\space counter register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@dimen}{}{s}{233}{32767} + \message{ \regstats@dimen\space dimen register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@skip}{}{s}{233}{32767} + \message{ \regstats@skip\space skip register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@muskip}{}{s}{255}{32767} + \message{ \regstats@muskip\space muskip register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@box}{}{s}{233}{32767} + \message{ \regstats@box\space box register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@toks}{}{s}{255}{32767} + \message{ \regstats@toks\space toks register\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@read}{}{s}{15}{15} + \message{ \regstats@read\space input stream\regstats@pl\space (read) out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@write}{}{s}{15}{15} + \message{ \regstats@write\space output stream\regstats@pl\space (write) out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@fam}{y}{ies}{15}{15} + \message{ \regstats@fam\space math famil\regstats@pl\space (fam) out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@language}{}{s}{255}{255} + \message{ \regstats@language\space language code\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \regstats@regstat{\regstats@insert}{}{s}{101}{124} + \message{ \regstats@insert\space insertion\regstats@pl\space out of \regstats@max \regstats@lft ^^J} + \ifregstats@timer + \message{^^J} + \setcounter{regstatscount}{\the\pdfelapsedtime} + \edef\regstatselapsedtime{\arabic{regstatscount}} + \divide \value{regstatscount} by 65536% scaledseconds -> seconds + \edef\regstatsseconds{\arabic{regstatscount}} + \ifnum \value{regstatscount} > 59 + \edef\regstatsseconds{\intcalcMod{\value{regstatscount}}{60}} + \divide \value{regstatscount} by 60% seconds -> minutes + \else + \setcounter{regstatscount}{0}% minutes = 0 + \fi + \ifnum \regstatsseconds < 10 + \message{Time elapsed for the last compiler run:^^J% + about \arabic{regstatscount}:0\regstatsseconds\space% + (m:ss; \regstatselapsedtime /65536 s).^^J} + \else + \message{Time elapsed for the last compiler run:^^J% + about \arabic{regstatscount}:\regstatsseconds \space% + (m:ss; \regstatselapsedtime /65536 s).^^J} + \fi \fi - \fi - } - } + }% + }% + }% + }% + }% + }% +} \endinput %% |