summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx58
1 files changed, 29 insertions, 29 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
index 5fe3d23d968..76e9b809b98 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
@@ -9,7 +9,7 @@
%%
%% http://www.latex-project.org/lppl.txt
%%
-%% This file is part of the "expl3 bundle" (The Work in LPPL)
+%% This file is part of the "l3kernel bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3names}
-\GetIdInfo$Id: l3alloc.dtx 2528 2011-08-09 09:10:06Z joseph $
+\GetIdInfo$Id: l3alloc.dtx 2776 2011-09-07 18:33:19Z joseph $
{L3 Experimental register allocation}
%</driver|package>
%<*driver>
@@ -78,13 +78,13 @@
% \item |\box255| is reserved for use in the output routine, so it
% should not be allocated otherwise.
% \item \TeX{} can load up 256 hyphenation patterns (registers
-% |\tex_language:D| 0--255),
+% \tn{language} 0--255),
% \item \TeX{} can load no more than 16 math families,
% \item \TeX{} supports no more than 16 I/O streams for reading
-% (|\tex_read:D|) and 16 I/O streams for writing (|\tex_write:D|),
+% (\tn{read}) and 16 I/O streams for writing (\tn{write}),
% \item \TeX{} supports no more than 256 inserts.
-% \item The other registers (|\tex_count:D|, |\tex_dimen:D|,
-% |\tex_skip:D|, |\tex_muskip:D|, |\tex_box:D|, and |\tex_toks:D|
+% \item The other registers (\tn{count}, \tn{dimen},
+% \tn{skip}, \tn{muskip}, \tn{box}, and \tn{toks})
% range from 0 to 32768, but registers numbered above 255 are
% accessed somewhat less efficiently.
% \item Registers could be allocated both globally and locally; the
@@ -96,7 +96,7 @@
% register was allocated last and which registers can not be
% allocated by the standard mechanisms.
%
-% \begin{function}{\alloc_new:nnnN}
+% \begin{function}[updated = 2011-09-05]{\alloc_new:nnnN}
% \begin{syntax}
% \cs{alloc_new:nnnN} \Arg{type} \Arg{min} \Arg{max} \meta{function}
% \end{syntax}
@@ -112,7 +112,7 @@
%
% \section{Internal functions}
%
-% \begin{function}{\alloc_setup_type:nnn}
+% \begin{function}[updated = 2011-09-05]{\alloc_setup_type:nnn}
% \begin{syntax}
% \cs{alloc_setup_type:nnn} \Arg{type} \Arg{min} \Arg{max}
% \end{syntax}
@@ -126,8 +126,8 @@
% \cs{alloc_reg:nNN} \Arg{type} \meta{function} \meta{register}
% \end{syntax}
% Preforms the allocation for a new \meta{register} of \meta{type},
-% using the allocator \meta{function} (which will be either a
-% primitive \cs{tex_\ldots def:D} or \cs{tex_chardef:D}).
+% using the allocator \meta{function} (which will be either a
+% primitive \tn{\ldots def} or \tn{chardef}).
% \end{function}
%
% \end{documentation}
@@ -139,11 +139,11 @@
% \begin{macrocode}
%<*initex>
% \end{macrocode}
-%
+%
% \begin{macro}{\alloc_new:nnnN}
% Shorthand for defining new register types and their allocators:
% \begin{macrocode}
-\cs_new:Npn \alloc_new:nnnN #1#2#3#4
+\cs_new_protected:Npn \alloc_new:nnnN #1#2#3#4
{
\alloc_setup_type:nnn {#1} {#2} {#3}
\cs_new_nopar:cpn { #1 _new:N } ##1 { \alloc_reg:nNN {#1} #4 ##1 }
@@ -156,7 +156,7 @@
% last allocated global register, plus a constant for the maximum
% allocation. We also need a sequence to store the \enquote{exceptions}.
% \begin{macrocode}
-\cs_new_nopar:Npn \alloc_setup_type:nnn #1#2#3
+\cs_new_protected:Npn \alloc_setup_type:nnn #1#2#3
{
\tl_new:c { g_ #1 _allocation_tl }
\tl_gset:cx { g_ #1 _allocation_tl } { \int_eval:n {#2} }
@@ -165,7 +165,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\int_eval:n}
% For bootstrapping purposes, a definition of \cs{int_eval:n} is needed
% in terms of primitives. This is replaced in \pkg{l3int} with a clearer
@@ -174,7 +174,7 @@
\cs_new:Npn \int_eval:n #1 { \tex_number:D \etex_numexpr:D #1 \scan_stop: }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}
% {box_new:N, \dim_new:N, \int_new:N, \muskip_new:N \skip_new:N}
% To get everything to work correctly for inserts, some register types
@@ -188,7 +188,7 @@
\alloc_new:nnnN { skip } \c_zero \c_max_register_int \tex_skipdef:D
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\insert_new:N}
% \begin{macro}[aux]{\alloc_reserve_insert:n}
% For inserts, there is a need to reserve space in various other registers.
@@ -210,35 +210,35 @@
\exp_args:Nf \alloc_reserve_insert:n
{ \etex_numexpr:D #1 + 1 \scan_stop: }
}
- }
+ }
\alloc_reserve_insert:n { 221 }
\group_end:
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% Box $255$ is reserved by \TeX{} for output, so is protected here from
% use by the allocator.
% \begin{macrocode}
\seq_put_right:Nn \g_box_allocation_seq { 255 }
% \end{macrocode}
%
-% \begin{macro}[int]{\alloc_reg:nNN}
-% This internal macro performs the actual allocation.
+% \begin{macro}[int]{\alloc_reg:nNN}
+% This internal macro performs the actual allocation.
% \begin{macrocode}
-\cs_new_nopar:Npn \alloc_reg:nNN #1#2#3
+\cs_new_protected_nopar:Npn \alloc_reg:nNN #1#2#3
{
\chk_if_free_cs:N #3
- \pref_global:D #2 #3 \tl_use:c { g_ #1 _allocation_tl } \scan_stop:
+ \tex_global:D #2 #3 \tl_use:c { g_ #1 _allocation_tl } \scan_stop:
\iow_log:x
- {
+ {
\token_to_str:N #3 ~=~ #1 ~register~
\tl_use:c { g_ #1 _allocation_tl }
}
\alloc_next:n {#1}
- }
+ }
% \end{macrocode}
-% \end{macro}
+% \end{macro}
%
% \begin{macro}[aux]{\alloc_next:n}
% Finding the next register to use is a question of doing an increment
@@ -247,12 +247,12 @@
% first but that needs an additional calculation.) There is a built-in
% loop to handle reserved allocation positions.
% \begin{macrocode}
-\cs_new_nopar:Npn \alloc_next:n #1
+\cs_new_protected_nopar:Npn \alloc_next:n #1
{
\tl_gset:cx { g_ #1 _allocation_tl }
{ \int_eval:n { \tl_use:c { g_ #1 _allocation_tl } + 1 } }
\int_compare:nNnTF
- { \tl_use:c { g_ #1 _allocation_tl } }
+ { \tl_use:c { g_ #1 _allocation_tl } }
> { \tl_use:c { c_ #1 _allocation_max_tl } }
{ \msg_kernel_fatal:nnx { alloc } { out-of-registers } {#1} }
{
@@ -262,12 +262,12 @@
}
}
% \end{macrocode}
-% \end{macro}
+% \end{macro}
%
% \begin{macrocode}
%</initex>
% \end{macrocode}
%
% \end{implementation}
-%
+%
% \PrintIndex