
(********************************************************************)
(*                                                                  *)
(*  tee.s7i       Filter file which emulates the tee functionality  *)
(*  Copyright (C) 1992, 1993, 1994, 2005  Thomas Mertes             *)
(*                                                                  *)
(*  This file is part of the Seed7 Runtime Library.                 *)
(*                                                                  *)
(*  The Seed7 Runtime Library is free software; you can             *)
(*  redistribute it and/or modify it under the terms of the GNU     *)
(*  Lesser General Public License as published by the Free Software *)
(*  Foundation; either version 2.1 of the License, or (at your      *)
(*  option) any later version.                                      *)
(*                                                                  *)
(*  The Seed7 Runtime Library is distributed in the hope that it    *)
(*  will be useful, but WITHOUT ANY WARRANTY; without even the      *)
(*  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR *)
(*  PURPOSE.  See the GNU Lesser General Public License for more    *)
(*  details.                                                        *)
(*                                                                  *)
(*  You should have received a copy of the GNU Lesser General       *)
(*  Public License along with this program; if not, write to the    *)
(*  Free Software Foundation, Inc., 51 Franklin Street,             *)
(*  Fifth Floor, Boston, MA  02110-1301, USA.                       *)
(*                                                                  *)
(********************************************************************)


const type: tee_file is sub null_file struct
    var file: out_file1 is STD_NULL;
    var file: out_file2 is STD_NULL;
  end struct;


const func tee_file: open_tee (ref file: out_fil1, ref file: out_fil2) is func
  result
    var tee_file: result is tee_file.value;
  begin
    result := tee_file.value;
    result.out_file1 := out_fil1;
    result.out_file2 := out_fil2;
  end func;


const proc: write (inout tee_file: tee_fil, ref string: stri) is func
  begin
    write(tee_fil.out_file1, stri);
    write(tee_fil.out_file2, stri);
  end func;


const proc: writeln (inout tee_file: tee_fil) is func
  begin
    writeln(tee_fil.out_file1);
    writeln(tee_fil.out_file2);
  end func;


const proc: backSpace (inout tee_file: tee_fil) is func
  begin
    backSpace(tee_fil.out_file1);
    backSpace(tee_fil.out_file2);
  end func;


(*
const proc: cursor_on (ref tee_file: tee_fil) is func
  begin
    cursor_on(tee_fil.out_file1);
    cursor_on(tee_fil.out_file2);
  end func;


const proc: cursor_off (ref tee_file: tee_fil) is func
  begin
    cursor_off(tee_fil.out_file1);
    cursor_off(tee_fil.out_file2);
  end func;
*)
