Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/lib/texmf/tex/generic/misc/localloc.sty

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


%% 
%% This is file `localloc.sty',
%% generated with the docstrip utility.
%% 
%% The original source files were:
%% 
%% localloc.dtx  (with options: `package')
%% 
%% This is a file of the `localloc' package reimplementing 
%% plain-TeX's and LaTeX's basic allocation macros to allow 
%% local allocation of registers. 
%% 
%% -- Copyright (C) 1991-1995 Bernd Raichle. All rights reserved -- 
%% 
%% This package is distributed in the hope that it will be useful, 
%% but WITHOUT ANY WARRANTY; without even the implied warranty of 
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
%% 
%% 
%% IMPORTANT NOTICE: 
%% 
%% Copying of this file is authorized only if either 
%% (1) you make absolutely no changes to your copy, including name, or 
%% (2) if you do make changes, you name it something other than 
%% localloc.dtx, localloc.doc, localloc.tex, or localloc.sty. 
%% 
%% For error reports see original source file `localloc.dtx'. 
%% 
\expandafter\ifx\csname lnewcount\endcsname\relax
\else \expandafter\endinput \fi
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
\else
  \NeedsTeXFormat{LaTeX2e}
  \ProvidesPackage{localloc}%
    [1995/09/24 v1.1b %
     Additional LaTeX Kernel Macros (local allocation)]
\fi
\expandafter\chardef\csname lcllc@at\endcsname=\catcode`\@
\catcode`\@=11 % \makeatletter
\def\lcllc@cnvmutocnt#1{\expandafter\lcllc@delmukey\the#1}
\begingroup \catcode`\M=12 \catcode`\U=12 \catcode`\.=12
  \lowercase{\endgroup
\def\lcllc@delmukey#1.#2MU{#1}}
\countdef\count@ptr    = 10
\countdef\dimen@ptr    = 11
\countdef\skip@ptr     = 12
\countdef\muskip@ptr   = 13
\countdef\box@ptr      = 14
\countdef\toks@ptr     = 15
\countdef\read@ptr     = 16
\countdef\write@ptr    = 17
\countdef\mathfam@ptr  = 18
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname newlanguage\endcsname\relax
  \csname newcount\endcsname\language@ptr
\else
  \countdef\language@ptr = 19
\fi
\newmuskip\count@limit  \count@limit  = \the\insc@unt mu
\newmuskip\dimen@limit  \dimen@limit  = \the\insc@unt mu
\newmuskip\skip@limit   \skip@limit   = \the\insc@unt mu
\newmuskip\box@limit    \box@limit    = \the\insc@unt mu
\newmuskip\muskip@limit \muskip@limit = 256mu
\newmuskip\toks@limit   \toks@limit   = 256mu
\newmuskip\cclvi@mu     \cclvi@mu     = 256mu
\newmuskip\xvi@mu       \xvi@mu       = 16mu
\def\newcount  {\alloc@\count@ptr  \count@limit \count  1\countdef }
\def\newdimen  {\alloc@\dimen@ptr  \dimen@limit \dimen  1\dimendef }
\def\newskip   {\alloc@\skip@ptr   \skip@limit  \skip   1\skipdef  }
\def\newmuskip {\alloc@\muskip@ptr \muskip@limit\muskip 0\muskipdef}
\def\newbox    {\alloc@\box@ptr    \box@limit   \box    1\chardef  }
\def\newtoks   {\alloc@\toks@ptr   \toks@limit  \toks   0\toksdef  }
\def\newread   {\alloc@\read@ptr   \xvi@mu      \read   0\chardef  }
\def\newwrite  {\alloc@\write@ptr  \xvi@mu      \write  0\chardef  }
\def\newfam    {\alloc@\mathfam@ptr\xvi@mu      \fam    0\chardef  }
\def\newlanguage{\alloc@\lang@ptr  \cclvi@mu   \language0\chardef  }
\def\lnewcount {\lalloc@\count@ptr \count@limit \count  1\countdef }
\def\lnewdimen {\lalloc@\dimen@ptr \dimen@limit \dimen  1\dimendef }
\def\lnewskip  {\lalloc@\skip@ptr  \skip@limit  \skip   1\skipdef  }
\def\lnewmuskip{\lalloc@\muskip@ptr\muskip@limit\muskip 0\muskipdef}
\def\lnewbox   {\lalloc@\box@ptr   \box@limit   \box    1\chardef  }
\def\lnewtoks  {\lalloc@\toks@ptr  \toks@limit  \toks   0\toksdef  }
\def\lcllc@insnums{}
\def\lcllc@checkins#1{%
  \begingroup
    \def\do##1.{%
      \ifnum##1=\allocationnumber
        \advance\allocationnumber#1\relax
        \noexpand\lcllc@checkins{#1}%
      \fi}%
    \edef\x{\endgroup \lcllc@insnums}%
  \x}
\def\alloc@#1#2#3#4{%
  \allocationnumber#1%
  \advance\allocationnumber\@ne
  \ifnum#4=\@ne \lcllc@checkins\@ne \fi
  \global#1\allocationnumber
  \ch@ck#1#2#3%
  \lcllc@def\global{}#3}
\def\lalloc@#1#2#3#4{%
  \allocationnumber\lcllc@cnvmutocnt#2%
  \advance\allocationnumber\m@ne
  \ifnum#4=\@ne \lcllc@checkins\m@ne \fi
  #2\the\allocationnumber mu %
  \ch@ck#1#2#3%
  \lcllc@def\relax{(local)}#3}
\def\ch@ck#1#2#3{%
  \ifnum#1<\lcllc@cnvmutocnt#2\relax \else
    \errmessage{No room for a new #3}%
    % \allocationnumber\m@ne
  \fi}
\def\lcllc@def#1#2#3#4#5{%
  #1#4#5=\allocationnumber
  \wlog{\string#5#2=\string#3\the\allocationnumber}}
\def\lcllc@getmax#1{%
  \ifnum#1<\allocationnumber \else
    \allocationnumber#1\advance\allocationnumber\@ne
  \fi}
\outer\def\newinsert{%
  \allocationnumber\m@ne
  \lcllc@getmax\count@ptr \lcllc@getmax\dimen@ptr
  \lcllc@getmax\skip@ptr  \lcllc@getmax\box@ptr
  \lcllc@checkins\@ne
  \ch@ck\allocationnumber\count@limit\count
  \ch@ck\allocationnumber\dimen@limit\dimen
  \ch@ck\allocationnumber\skip@limit\skip
  \ch@ck\allocationnumber\box@limit\box
  \begingroup
    \let\do\relax
    \xdef\lcllc@insnums{\do\the\allocationnumber.\lcllc@insnums}%
  \endgroup
  \lcllc@def\global{}\insert\chardef}
\catcode`\@=\lcllc@at
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\endinput
%% 
%% End of file `localloc.sty'.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.