summaryrefslogtreecommitdiff
path: root/macros/plain/contrib/misc/declare.tex
blob: b97e704bdf142fead95e7dcd2946876a494d4e49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% File:       TeX Inputs declare.tex
% Author:     J E Pittman
% Date:       September 29, 1988
%
% Revision 01-Jun-1990
% 	Changed count19 to count20 to conform to TeX 3.0
%       - Neil Burleson (NABTEXM@TAMVENUS)
%
% These macros provide a method of locally allocating registers
% without interference with previously allocated registers.  The
% method is the same as on pages 346--347 of the \TeX book, however,
% the declare macros are intended for local use only.  It is a logical
% error to use a new macro between a declare macro and the end of the
% appropriate enclosing group.
%
\def\declarecount {\allocate0\countdef}%
\def\declaredimen {\allocate1\dimendef}%
\def\declareskip  {\allocate2\skipdef}%
\def\declaremuskip{\allocate3\muskipdef}%
\def\declarebox   {\allocate4\chardef}%
\def\declaretoks  {\allocate5\toksdef}%
%
\def\allocate#1#2#3{\relax
   \advance\count1#1 by 1
   \ifnum\count1#1<\count20
   \else
      \errmessage{No room for \string#3!}%
   \fi
   #2#3=\count1#1
   }%
%
\endinput