diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3io.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3io.sty | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3io.sty b/Master/texmf-dist/tex/latex/l3kernel/l3io.sty index 685dd7ca945..16312914578 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3io.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3io.sty @@ -13,7 +13,7 @@ %% %% Do not distribute a modified version of this file. %% -%% File: l3io.dtx Copyright (C) 1990-2011 The LaTeX3 Project +%% File: l3io.dtx Copyright (C) 1990-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3io.dtx 3096 2011-12-27 09:09:18Z joseph $ +\GetIdInfo$Id: l3io.dtx 3160 2012-01-09 02:33:23Z bruno $ {L3 Experimental input-output operations} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -135,6 +135,8 @@ \tl_map_break: } } +\iow_new:N \g_iow_internal_iow +\ior_new:N \g_ior_internal_ior \cs_new_protected:Npn \iow_stream_alloc:N #1 { \cs_if_exist:cTF { g_iow_ \int_use:N \l_iow_stream_int _iow } @@ -143,10 +145,10 @@ \iow_stream_alloc_aux: \int_compare:nNnT \l_iow_stream_int = \c_sixteen { - \iow_raw_new:N \g_iow_tmp_iow - \int_set:Nn \l_iow_stream_int { \g_iow_tmp_iow } + \iow_raw_new:N \g_iow_internal_iow + \int_set:Nn \l_iow_stream_int { \g_iow_internal_iow } \cs_gset_eq:cN - { g_iow_ \int_use:N \l_iow_stream_int _iow } \g_iow_tmp_iow + { g_iow_ \int_use:N \l_iow_stream_int _iow } \g_iow_internal_iow } \cs_gset_eq:Nc #1 { g_iow_ \int_use:N \l_iow_stream_int _iow } } @@ -172,10 +174,10 @@ \ior_stream_alloc_aux: \int_compare:nNnT \l_ior_stream_int = \c_sixteen { - \ior_raw_new:N \g_ior_tmp_ior - \int_set:Nn \l_ior_stream_int { \g_ior_tmp_ior } + \ior_raw_new:N \g_ior_internal_ior + \int_set:Nn \l_ior_stream_int { \g_ior_internal_ior } \cs_gset_eq:cN - { g_ior_ \int_use:N \l_iow_stream_int _ior } \g_ior_tmp_ior + { g_ior_ \int_use:N \l_iow_stream_int _ior } \g_ior_internal_ior } \cs_gset_eq:Nc #1 { g_ior_ \int_use:N \l_ior_stream_int _ior } } @@ -462,6 +464,39 @@ { \etex_readline:D #1 to #2 } \cs_new_protected:Npn \ior_str_gto:NN #1#2 { \tex_global:D \etex_readline:D #1 to #2 } +\tl_new:N \l_ior_internal_tl +\cs_new_protected_nopar:Npn \ior_map_inline:nn + { \ior_map_inline_aux:Nnn \ior_to:NN } +\cs_new_protected_nopar:Npn \ior_str_map_inline:nn + { \ior_map_inline_aux:Nnn \ior_str_to:NN } +\cs_new_protected_nopar:Npn \ior_map_inline_aux:Nnn + { + \exp_args:Ncc \ior_map_inline_aux:NNNnn + { g_ior_map_ \int_use:N \g_prg_map_int _ior } + { ior_map_ \int_use:N \g_prg_map_int :n } + } +\cs_new_protected:Npn \ior_map_inline_aux:NNNnn #1#2#3#4#5 + { + \cs_if_exist:NF #1 { \ior_new:N #1 } + \cs_set:Npn #2 ##1 {#5} + \ior_open:Nn #1 {#4} + \int_gincr:N \g_prg_map_int + \ior_if_eof:NF #1 { \ior_map_inline_loop:NNN #1#2#3 } + \prg_break_point:n + { + \int_gdecr:N \g_prg_map_int + \ior_close:N #1 + } + } +\cs_new_protected:Npn \ior_map_inline_loop:NNN #1#2#3 + { + #3 #1 \l_ior_internal_tl + \ior_if_eof:NF #1 + { + \exp_args:No #2 \l_ior_internal_tl + \ior_map_inline_loop:NNN #1#2#3 + } + } %% %% %% End of file `l3io.sty'. |