summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3io.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3io.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3io.sty97
1 files changed, 45 insertions, 52 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3io.sty b/Master/texmf-dist/tex/latex/l3kernel/l3io.sty
index c074dbf0ea2..685dd7ca945 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3io.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3io.sty
@@ -46,16 +46,15 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3io.dtx 3005 2011-11-25 13:19:47Z bruno $
+\GetIdInfo$Id: l3io.dtx 3096 2011-12-27 09:09:18Z joseph $
{L3 Experimental input-output operations}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\package_check_loaded_expl:
\cs_new_eq:NN \if_eof:w \tex_ifeof:D
-\cs_new_eq:NN \c_iow_term_stream \c_sixteen
-\cs_new_eq:NN \c_ior_term_stream \c_sixteen
-\cs_new_eq:NN \c_iow_log_stream \c_minus_one
-\cs_new_eq:NN \c_ior_log_stream \c_minus_one
+\cs_new_eq:NN \c_term_ior \c_sixteen
+\cs_new_eq:NN \c_log_iow \c_minus_one
+\cs_new_eq:NN \c_term_iow \c_sixteen
\tl_const:Nn \c_iow_streams_tl
{
\c_zero
@@ -88,34 +87,30 @@
\cs_set_eq:NN \ior_raw_new:N \newread
\cs_generate_variant:Nn \ior_raw_new:N { c }
\cs_generate_variant:Nn \iow_raw_new:N { c }
-\cs_new_protected_nopar:Npn \ior_new:N #1
- {
- \chk_if_free_cs:N #1
- \tex_global:D \tex_chardef:D #1 16 ~
- }
-\cs_new_eq:NN \iow_new:N \ior_new:N
+\cs_new_protected:Npn \ior_new:N #1 { \cs_new_eq:NN #1 \c_term_ior }
\cs_generate_variant:Nn \ior_new:N { c }
+\cs_new_protected:Npn \iow_new:N #1 { \cs_new_eq:NN #1 \c_term_iow }
\cs_generate_variant:Nn \iow_new:N { c }
-\cs_new_protected_nopar:Npn \ior_open:Nn #1#2
+\cs_new_protected:Npn \ior_open:Nn #1#2
{
\ior_close:N #1
\int_set:Nn \l_ior_stream_int \c_sixteen
\tl_map_function:NN \c_ior_streams_tl \ior_alloc_read:n
\int_compare:nNnTF \l_ior_stream_int = \c_sixteen
- { \msg_kernel_error:nn { ior } { streams-exhausted } }
+ { \msg_kernel_fatal:nn { ior } { streams-exhausted } }
{
\ior_stream_alloc:N #1
\prop_gput:NVn \g_ior_streams_prop \l_ior_stream_int {#2}
\tex_openin:D #1#2 \scan_stop:
}
}
-\cs_new_protected_nopar:Npn \iow_open:Nn #1#2
+\cs_new_protected:Npn \iow_open:Nn #1#2
{
\iow_close:N #1
\int_set:Nn \l_iow_stream_int \c_sixteen
\tl_map_function:NN \c_iow_streams_tl \iow_alloc_write:n
\int_compare:nNnTF \l_iow_stream_int = \c_sixteen
- { \msg_kernel_error:nn { iow } { streams-exhausted } }
+ { \msg_kernel_fatal:nn { iow } { streams-exhausted } }
{
\iow_stream_alloc:N #1
\prop_gput:NVn \g_iow_streams_prop \l_iow_stream_int {#2}
@@ -124,7 +119,7 @@
}
\cs_generate_variant:Nn \ior_open:Nn { c }
\cs_generate_variant:Nn \iow_open:Nn { c }
-\cs_new_protected_nopar:Npn \iow_alloc_write:n #1
+\cs_new_protected:Npn \iow_alloc_write:n #1
{
\prop_if_in:NnF \g_iow_streams_prop {#1}
{
@@ -132,7 +127,7 @@
\tl_map_break:
}
}
-\cs_new_protected_nopar:Npn \ior_alloc_read:n #1
+\cs_new_protected:Npn \ior_alloc_read:n #1
{
\prop_if_in:NnF \g_iow_streams_prop {#1}
{
@@ -140,21 +135,20 @@
\tl_map_break:
}
}
-\cs_new_protected_nopar:Npn \iow_stream_alloc:N #1
+\cs_new_protected:Npn \iow_stream_alloc:N #1
{
- \cs_if_exist:cTF { g_iow_ \int_use:N \l_iow_stream_int _stream }
- { \cs_gset_eq:Nc #1 { g_iow_ \int_use:N \l_iow_stream_int _stream } }
+ \cs_if_exist:cTF { g_iow_ \int_use:N \l_iow_stream_int _iow }
+ { \cs_gset_eq:Nc #1 { g_iow_ \int_use:N \l_iow_stream_int _iow } }
{
\iow_stream_alloc_aux:
\int_compare:nNnT \l_iow_stream_int = \c_sixteen
{
- \iow_raw_new:N \g_iow_tmp_stream
- \int_set:Nn \l_iow_stream_int { \g_iow_tmp_stream }
+ \iow_raw_new:N \g_iow_tmp_iow
+ \int_set:Nn \l_iow_stream_int { \g_iow_tmp_iow }
\cs_gset_eq:cN
- { g_iow_ \int_use:N \l_iow_stream_int _stream }
- \g_iow_tmp_stream
+ { g_iow_ \int_use:N \l_iow_stream_int _iow } \g_iow_tmp_iow
}
- \cs_gset_eq:Nc #1 { g_iow_ \int_use:N \l_iow_stream_int _stream }
+ \cs_gset_eq:Nc #1 { g_iow_ \int_use:N \l_iow_stream_int _iow }
}
}
\cs_new_protected_nopar:Npn \iow_stream_alloc_aux:
@@ -162,7 +156,7 @@
\int_incr:N \l_iow_stream_int
\int_compare:nNnT \l_iow_stream_int < \c_sixteen
{
- \cs_if_exist:cTF { g_iow_ \int_use:N \l_iow_stream_int _stream }
+ \cs_if_exist:cTF { g_iow_ \int_use:N \l_iow_stream_int _iow }
{
\prop_if_in:NVT \g_iow_streams_prop \l_iow_stream_int
{ \iow_stream_alloc_aux: }
@@ -170,21 +164,20 @@
{ \iow_stream_alloc_aux: }
}
}
-\cs_new_protected_nopar:Npn \ior_stream_alloc:N #1
+\cs_new_protected:Npn \ior_stream_alloc:N #1
{
- \cs_if_exist:cTF { g_ior_ \int_use:N \l_ior_stream_int _stream }
- { \cs_gset_eq:Nc #1 { g_ior_ \int_use:N \l_ior_stream_int _stream } }
+ \cs_if_exist:cTF { g_ior_ \int_use:N \l_ior_stream_int _ior }
+ { \cs_gset_eq:Nc #1 { g_ior_ \int_use:N \l_ior_stream_int _ior } }
{
\ior_stream_alloc_aux:
\int_compare:nNnT \l_ior_stream_int = \c_sixteen
{
- \ior_raw_new:N \g_ior_tmp_stream
- \int_set:Nn \l_ior_stream_int { \g_ior_tmp_stream }
+ \ior_raw_new:N \g_ior_tmp_ior
+ \int_set:Nn \l_ior_stream_int { \g_ior_tmp_ior }
\cs_gset_eq:cN
- { g_ior_ \int_use:N \l_iow_stream_int _stream }
- \g_ior_tmp_stream
+ { g_ior_ \int_use:N \l_iow_stream_int _ior } \g_ior_tmp_ior
}
- \cs_gset_eq:Nc #1 { g_ior_ \int_use:N \l_ior_stream_int _stream }
+ \cs_gset_eq:Nc #1 { g_ior_ \int_use:N \l_ior_stream_int _ior }
}
}
\cs_new_protected_nopar:Npn \ior_stream_alloc_aux:
@@ -192,7 +185,7 @@
\int_incr:N \l_ior_stream_int
\int_compare:nNnT \l_ior_stream_int < \c_sixteen
{
- \cs_if_exist:cTF { g_ior_ \int_use:N \l_ior_stream_int _stream }
+ \cs_if_exist:cTF { g_ior_ \int_use:N \l_ior_stream_int _ior }
{
\prop_if_in:NVT \g_ior_streams_prop \l_ior_stream_int
{ \ior_stream_alloc_aux: }
@@ -200,7 +193,7 @@
{ \ior_stream_alloc_aux: }
}
}
-\cs_new_protected_nopar:Npn \ior_close:N #1
+\cs_new_protected:Npn \ior_close:N #1
{
\cs_if_exist:NT #1
{
@@ -209,11 +202,11 @@
\int_compare:nNnF #1 = \c_sixteen
{ \tex_closein:D #1 }
\prop_gdel:NV \g_ior_streams_prop #1
- \tex_global:D \tex_chardef:D #1 16 ~
+ \cs_gset_eq:NN #1 \c_term_ior
}
}
}
-\cs_new_protected_nopar:Npn \iow_close:N #1
+\cs_new_protected:Npn \iow_close:N #1
{
\cs_if_exist:NT #1
{
@@ -222,7 +215,7 @@
\int_compare:nNnF #1 = \c_sixteen
{ \tex_closein:D #1 }
\prop_gdel:NV \g_iow_streams_prop #1
- \tex_global:D \tex_chardef:D #1 16 ~
+ \cs_gset_eq:NN #1 \c_term_iow
}
}
}
@@ -255,19 +248,19 @@
}
\cs_new_eq:NN \iow_shipout_x:Nn \tex_write:D
\cs_generate_variant:Nn \iow_shipout_x:Nn { Nx }
-\cs_new_protected_nopar:Npn \iow_shipout:Nn #1#2
+\cs_new_protected:Npn \iow_shipout:Nn #1#2
{ \iow_shipout_x:Nn #1 { \exp_not:n {#2} } }
\cs_generate_variant:Nn \iow_shipout:Nn { Nx }
\cs_new_protected_nopar:Npn \iow_now:Nx { \tex_immediate:D \iow_shipout_x:Nn }
-\cs_new_protected_nopar:Npn \iow_now:Nn #1#2
+\cs_new_protected:Npn \iow_now:Nn #1#2
{ \iow_now:Nx #1 { \exp_not:n {#2} } }
-\cs_set_protected_nopar:Npn \iow_log:x { \iow_now:Nx \c_iow_log_stream }
-\cs_new_protected_nopar:Npn \iow_log:n { \iow_now:Nn \c_iow_log_stream }
-\cs_set_protected_nopar:Npn \iow_term:x { \iow_now:Nx \c_iow_term_stream }
-\cs_new_protected_nopar:Npn \iow_term:n { \iow_now:Nn \c_iow_term_stream }
-\cs_new_protected_nopar:Npn \iow_now_when_avail:Nn #1
+\cs_set_protected_nopar:Npn \iow_log:x { \iow_now:Nx \c_log_iow }
+\cs_new_protected_nopar:Npn \iow_log:n { \iow_now:Nn \c_log_iow }
+\cs_set_protected_nopar:Npn \iow_term:x { \iow_now:Nx \c_term_iow }
+\cs_new_protected_nopar:Npn \iow_term:n { \iow_now:Nn \c_term_iow }
+\cs_new_protected:Npn \iow_now_when_avail:Nn #1
{ \cs_if_free:NTF #1 { \use_none:n } { \iow_now:Nn #1 } }
-\cs_new_protected_nopar:Npn \iow_now_when_avail:Nx #1
+\cs_new_protected:Npn \iow_now_when_avail:Nx #1
{ \cs_if_free:NTF #1 { \use_none:n } { \iow_now:Nx #1 } }
\cs_new_nopar:Npn \iow_newline: { ^^J }
\cs_new_eq:NN \iow_char:N \cs_to_str:N
@@ -394,7 +387,7 @@
\tl_set:Nx \l_iow_current_line_tl
{ \l_iow_current_indentation_tl \l_iow_current_word_tl }
}
-\cs_new_protected_nopar:Npn \iow_wrap_special:w #1 ~ #2 ~ #3 ~ %
+\cs_new_protected:Npn \iow_wrap_special:w #1 ~ #2 ~ #3 ~ %
{
\use:c { iow_wrap_#1: }
\str_if_eq:xxTF { #2~#3 } { ~ \c_iow_wrap_marker_tl }
@@ -461,13 +454,13 @@
}
{ \prg_return_true: }
}
-\cs_new_protected_nopar:Npn \ior_to:NN #1#2
+\cs_new_protected:Npn \ior_to:NN #1#2
{ \tex_read:D #1 to #2 }
-\cs_new_protected_nopar:Npn \ior_gto:NN #1#2
+\cs_new_protected:Npn \ior_gto:NN #1#2
{ \tex_global:D \tex_read:D #1 to #2 }
-\cs_new_protected_nopar:Npn \ior_str_to:NN #1#2
+\cs_new_protected:Npn \ior_str_to:NN #1#2
{ \etex_readline:D #1 to #2 }
-\cs_new_protected_nopar:Npn \ior_str_gto:NN #1#2
+\cs_new_protected:Npn \ior_str_gto:NN #1#2
{ \tex_global:D \etex_readline:D #1 to #2 }
%%
%%