summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3io.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3io.sty')
-rw-r--r--Master/texmf-dist/tex/latex/expl3/l3io.sty116
1 files changed, 65 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3io.sty b/Master/texmf-dist/tex/latex/expl3/l3io.sty
index 608c6b7c624..5ea97d6b61a 100644
--- a/Master/texmf-dist/tex/latex/expl3/l3io.sty
+++ b/Master/texmf-dist/tex/latex/expl3/l3io.sty
@@ -15,7 +15,7 @@
%% Do not distribute a modified version of this file.
%%
%%
-%% File: l3io.dtx Copyright (C) 1990-2006 LaTeX3 project
+%% File: l3io.dtx Copyright (C) 1990-2009 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
@@ -33,7 +33,7 @@
%%
%% The development version of the bundle can be found at
%%
-%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/
+%% http://www.latex-project.org/svnroot/experimental/trunk/
%%
%% for those people who are interested.
%%
@@ -48,59 +48,73 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3io.dtx 621 2007-09-01 20:14:19Z morten $
+\GetIdInfo$Id: l3io.dtx 1369 2009-05-31 21:36:35Z joseph $
{L3 Experimental i/o module}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
-\RequirePackage{l3toks}\par
-\let:NN \iow_new:N \newwrite
-\def_new:Npn \iow_new:c {\exp_args:Nc \iow_new:N}
-\def_new:Npn \iow_open:Nn #1#2{\iow_close:N #1
- \tex_immediate:D\tex_openout:D#1#2\scan_stop:}
-\def_new:Npn \iow_open:cn {\exp_args:Nc \iow_open:Nn}
-\def_new:Npn \iow_close:N {\tex_immediate:D\tex_closeout:D}
-\let_new:NN \c_io_term_stream \c_sixteen
-\let_new:NN \c_iow_log_stream \c_minus_one
-\def_new:Npn \iow_expanded:Nn {\tex_immediate:D\iow_deferred_expanded:Nn}
-\def_new:Npn \iow_unexpanded:Nn #1#2{
- \iow_expanded:Nn #1{\exp_not:n{#2}}}
-\def:Npn \iow_expanded_log:n {\iow_expanded:Nn \c_iow_log_stream}
-\def:Npn \iow_expanded_term:n{\iow_expanded:Nn \c_io_term_stream}
-
-\def_new:Npn \iow_unexpanded_term:n {\iow_unexpanded:Nn \c_io_term_stream}
-\def_new:Npn \iow_unexpanded_if_avail:Nn #1{
- \cs_free:NTF #1\use_none:n {\iow_unexpanded:Nn #1}}
-\def_new:Npn \iow_unexpanded_if_avail:cn {
- \exp_args:Nc \iow_unexpanded_if_avail:Nn }
-\def_new:Npn \iow_long_expanded_aux:w #1#2#3{
- \group_begin:\tex_newlinechar:D`\ #1#2{#3}\group_end:}
-\def_new:Npn \iow_long_expanded:Nn {\iow_long_expanded_aux:w
- \iow_expanded:Nn}
-\def_new:Npn \iow_long_unexpanded:Nn {\iow_long_expanded_aux:w
- \iow_unexpanded:Nn}
-\let:NN \iow_deferred_expanded:Nn \tex_write:D
-\def_new:Npn \iow_deferred_unexpanded:Nn #1#2{
- \iow_deferred_expanded:Nn{\exp_not:n{#2}}
+\package_check_loaded_expl:
+\cs_set_eq:NN \iow_new:N \newwrite
+\cs_generate_variant:Nn \iow_new:N {c}
+\cs_new_nopar:Npn \iow_open:Nn #1#2 {
+ \iow_close:N #1
+ \tex_immediate:D \tex_openout:D #1#2 \scan_stop:
+}
+\cs_generate_variant:Nn \iow_open:Nn {c}
+\cs_new_nopar:Npn \iow_close:N { \tex_immediate:D \tex_closeout: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_nopar:Npn \iow_now:Nx { \tex_immediate:D \iow_shipout_x:Nn }
+\cs_new_nopar:Npn \iow_now:Nn #1#2 {
+ \iow_now:Nx #1 { \exp_not:n {#2} }
+}
+\cs_set_nopar:Npn \iow_log:x { \iow_now:Nx \c_iow_log_stream }
+\cs_new_nopar:Npn \iow_log:n { \iow_now:Nn \c_iow_log_stream }
+\cs_set_nopar:Npn \iow_term:x { \iow_now:Nx \c_iow_term_stream }
+\cs_new_nopar:Npn \iow_term:n { \iow_now:Nn \c_iow_term_stream }
+\cs_new_nopar:Npn \iow_now_when_avail:Nn #1 {
+ \cs_if_free:NTF #1 {\use_none:n} {\iow_now:Nn #1}
+}
+\cs_generate_variant:Nn \iow_now_when_avail:Nn {c}
+\cs_new_nopar:Npn \iow_now_buffer_safe_aux:w #1#2#3 {
+ \group_begin: \tex_newlinechar:D`\ #1#2{#3} \group_end:
+}
+\cs_new_nopar:Npn \iow_now_buffer_safe:Nx {
+ \iow_now_buffer_safe_aux:w \iow_now:Nx
+}
+\cs_new_nopar:Npn \iow_now_buffer_safe:Nn {
+ \iow_now_buffer_safe_aux:w \iow_now:Nn
+}
+\cs_set_eq:NN \iow_shipout_x:Nn \tex_write:D
+\cs_generate_variant:Nn \iow_shipout_x:Nn {Nx}
+\cs_new_nopar: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_nopar:Npn \iow_newline: {^^J}
+\cs_new_nopar:Npn \iow_space: {~}
+\cs_new:Nn \iow_char:N { \cs_to_str:N #1 }
+\tl_new:Nx \c_iow_comment_char {\cs_to_str:N\%}
+\tl_new:Nx \c_iow_lbrace_char{\cs_to_str:N\{}
+\tl_new:Nx \c_iow_rbrace_char{\cs_to_str:N\}}
+\cs_set_eq:NN \ior_new:N \newread
+\cs_set_eq:NN \ior_close:N \tex_closein:D
+\cs_new_nopar:Npn \ior_open:Nn #1#2 {
+ \ior_close:N #1 \scan_stop:
+ \tex_openin:D #1#2 \scan_stop:
+}
+\cs_new_eq:NN \if_eof:w \tex_ifeof:D
+\prg_new_conditional:Nnn \ior_if_eof:N {p,TF,T,F} {
+ \tex_ifeof:D #1 \prg_return_true: \else: \prg_return_false: \fi:
+}
+\cs_new_nopar:Npn \ior_to:NN #1#2 {
+ \tex_read:D #1 to #2
+}
+\cs_new_nopar:Npn \ior_gto:NN {
+ \pref_global:D
+ \ior_to:NN
}
-%% Old implementation:
-\def_new:Npn \iow_newline: {^^J}
-\tlp_new:Nx \c_iow_comment_char {\cs_to_str:N\%}
-\tlp_new:Nx \c_iow_lbrace_char{\cs_to_str:N\{}
-\tlp_new:Nx \c_iow_rbrace_char{\cs_to_str:N\}}
-\let:NN \ior_new:N \newread
-\let:NN \ior_close:N \tex_closein:D
-\def_new:Npn \ior_open:Nn #1#2{\ior_close:N #1\scan_stop:
- \tex_openin:D#1#2\scan_stop:}
-\def_new:Npn \ior_eof:NTF #1{\if_eof:w#1
- \exp_after:NN\use_arg_i:nn \else:
- \exp_after:NN\use_arg_ii:nn \fi:}
-\let:NN \if_eof:w \tex_ifeof:D
-\def_new:Npn \ior_eof:NF #1{\if_eof:w#1
- \exp_after:NN \use_none:nn \fi: \use_arg_i:n}
- \def_new:Npn \ior_to:NN #1{\tex_read:D#1to}
-\def_new:Npn \ior_gto:NN {
- \pref_global:D
- \ior_to:NN}
%%
%%
%% End of file `l3io.sty'.